Basic c++
Resource file Icon file not found (please change it in Project Options)
I'm learning c++ and this is a very simple program i wrote.
// using variables
#include <iostream> using namespace std;
int main () { short int a, b , c, result; a = 7 b = 8 c = 15 result = a + b - c } if (result = 1) { cout << " you are wrong" << end1; { } else { cout << "you are correct" << end1; } return 0; {
when i tried to compile and run it this came up; Resource file Icon file not found (please change it in Project Options)
Im using dev - c++ 4
naw its not working..im screwing around with project options but its still not working
Haven't used Dev C++, but I'm gonna take a stab at it and say that you need to check your Project Options. Does your "Hello World" prog have a GUI with it, or is it a command-line prog? If it has a GUI, I'd say that your prog is having a problem with an icon on the GUI. If not… still, fish a bit in the Project Options, and I'm sure you'll find something.
Edit: When I programmed in C++ in high school, I don't recall having to use "using namespace std;" when doing this type of prog. As far as I can remember, iostream covers it.
oblivionprogrammer wrote:
// using variables
#include <iostream> using namespace std;
int main () { short int a, b , c, result; a = 7 b = 8 c = 15 result = a + b - c if (result == 1) { cout << " you are wrong" << endl; } else { cout << "you are correct" << endl; } return 0; }
There were some errors, I've fixed them and marked with red :p I also removed some stuff; the main function was ended in the middle of the code ^^
Uber0n wrote: [quote]oblivionprogrammer wrote:
// using variables
#include <iostream> using namespace std;
int main () { short int a, b , c, result; a = 7; b = 8; c = 15; result = a + b - c; if (result == 1) { cout << " you are wrong" << endl; } else { cout << "you are correct" << endl; } return 0; }
There were some errors, I've fixed them and marked with red :p I also removed some stuff; the main function was ended in the middle of the code ^1
Uber, you forgot something :P I marked it with lime :)
/quote ↩
There shouldn't be any problems unless you created a Win32 GUI project, and in that case it will be trying to search for a different entry point (WinMain()).
#include <iostream>
using std::cout;
using std::endl;
int main ()
{
short int a=7,
b=8,
c=15,
result;
(!(result = a+b-c)) ? cout << "you are correct" << endl : cout << "you are wrong" << endl;
return 0;
}
Zephyr_Pure wrote: Edit: When I programmed in C++ in high school, I don't recall having to use "using namespace std;" when doing this type of prog. As far as I can remember, iostream covers it. Long time since I've touched C++, but wont you have to write "std::cout" instead of "cout" if you omit using the std namespace?