#include <iostream>
usingnamespace std;
int main ()
{
cout << "Hello World!";
return 0;
}
to see what will happens, but nothings happens. I paste it in new window application, and compile it then run, but it still nothing happens. Is there any problems?
There is nothing wrong with it per say. You just need another line to make it where the program waits till you press enter to exit the program. That way you get to see the program run.
the line is:
system("PAUSE")
Here is the code with that included (Line 7):
1 2 3 4 5 6 7 8 9
#include <iostream>
usingnamespace std;
int main ()
{
cout << "Hello World!";
system("PAUSE");
return 0;
}
Every time I see a console referred to as MS-DOS my stomach tries to digest itself.
Unless you're using a very old compiler (which you shouldn't anyway), nowadays its impossible to generate code for DOS.
DOS was a 16-bit operating system that used a console as its main user interface (that's not to say it was the only one).
A console is a text-based user interface that takes input from the keyboard and places text-only output on a screen (although it's possible to make a console that sends its output to a printer for logging purposes).
The console seen today in Windows is 32-bit however you look at it. A program that uses it may be as much of a Windows program as notepad.exe, the only difference between the two being that one has a GUI and the other doesn't.
cmd.exe, as the current Windows console is called, is capable of running DOS programs by emulating it.
Ehe, How to build gui? I start over it with press the new buttons, then in the gui tab, there are two things (fox1.4.9 and another is fox). I choose the first second(fox) then then paste the code in at the very under of the code, after that I compile it and it come out 2 error message like (`int main()' ) conflicts with)(below first code) and another error message is (`int main(int, char**)' here )(below the second code) and fail to build it.
1 2 3 4 5 6 7 8
#include <iostream>
usingnamespace std;
int main ()
{//the error message said the bracket has
cout << "Hello World!";
return 0;
}
1 2 3 4 5 6 7 8 9 10 11 12 13
int main(int argc, char **argv)//i only copy the part of the gui or fox that the error message appear
{//the error said this brackets has error
FXApp app("FOX Application", "Foobar Corporation");
app.init(argc, argv);
MainWindow *w = new MainWindow(&app);
app.addSignal(SIGINT, w, MainWindow::ID_QUIT);
app.create();
w->show(PLACEMENT_CURSOR);
w->setFocus();
return app.run();
}
You mean I have to make new file in the project tab? before this i'm really only paste both of them in once in a same place. Now i make new project after make the GUI, and paste the hello world code again, then compile it and run, but one error message come out again" [resources error] no resources". Then i compile it again more error message came out" multiple definition of `main' " and " first defined here " and " cannot find -lpng " and " ld returned 1 exit status ".
On the home page of that tutorial site you can download the source code for all of the examples there. Find the source from that example and you can learn from it.