can someone write a simple programm for me it should just take a minute
-
Hello, I have a problem with the .exe's that I make. I open them and they close very fast so you can hardly read it or not. I asked this question a while ago but now I ask if one of you would write the programm "hello world" with the getch() command because that's what they advised me but I have no Idea how. n00b Thomas
-
Hello, I have a problem with the .exe's that I make. I open them and they close very fast so you can hardly read it or not. I asked this question a while ago but now I ask if one of you would write the programm "hello world" with the getch() command because that's what they advised me but I have no Idea how. n00b Thomas
-
this is what I did and when I try to compile now he gives an error #include #include //I thought I needed this one as well int main() { cout << "hello world"; getch(); return 0; }
-
this is what I did and when I try to compile now he gives an error #include #include //I thought I needed this one as well int main() { cout << "hello world"; getch(); return 0; }
What is the compile error you get? The program in VS6 (generated console app wizard) should be as simple as #include #include int main(int argc, char* argv[]) { printf("Hello World!\n"); getch(); return 0; } Michael
-
this is what I did and when I try to compile now he gives an error #include #include //I thought I needed this one as well int main() { cout << "hello world"; getch(); return 0; }
-
#include conio.h #include iostream.h void main (void) { cout << "Hello World!\n"; getch(); // If I use return 0; there comes an error } Thomas
-
#include conio.h #include iostream.h void main (void) { cout << "Hello World!\n"; getch(); // If I use return 0; there comes an error } Thomas
-
#include conio.h #include iostream.h void main (void) { cout << "Hello World!\n"; getch(); // If I use return 0; there comes an error } Thomas
-
Your signature for main is strictly wrong - should be int main(int argc, char* argv[]) Then you return an int - ie 0 or anything else u want
In the book that I hired from the library and another one that I have at home both say this: #include iostream.h void main(void) { cout << "hello world"; } The problem is they used to work but know I can only open them in DOS that's not a problem for me but if I want to mail someone else my work and they don't know how to use DOS then it's a little problem. Thomas
-
In the book that I hired from the library and another one that I have at home both say this: #include iostream.h void main(void) { cout << "hello world"; } The problem is they used to work but know I can only open them in DOS that's not a problem for me but if I want to mail someone else my work and they don't know how to use DOS then it's a little problem. Thomas
jaapdeboer wrote: The problem is they used to work but know I can only open them in DOS that's not a problem for me but if I want to mail someone else my work and they don't know how to use DOS then it's a little problem. The executable itself will launch inside a command prompt as you have written it. If you want a windowed application you will need to write it as such. - Nick Parker
My Blog -
In the book that I hired from the library and another one that I have at home both say this: #include iostream.h void main(void) { cout << "hello world"; } The problem is they used to work but know I can only open them in DOS that's not a problem for me but if I want to mail someone else my work and they don't know how to use DOS then it's a little problem. Thomas
jaapdeboer wrote: In the book that I hired from the library and another one that I have at home both say this: #include iostream.h void main(void) { cout << "hello world"; } Not being funny, but those books are either full of crap, or seriously outdated (by at least 5 or 6 years). main returning void is non-standard (it can accept a void type for the parameter list). main does not require a return, however if it is missed, then there is an implicit return 0 included.
Ian Darling "The different versions of the UN*X brand operating system are numbered in a logical sequence: 5, 6, 7, 2, 2.9, 3, 4.0, III, 4.1, V, 4.2, V.2, and 4.3" - Alan Filipski