You are here:

C++/beginning with C-please!helpful


hello.i am from greece and i just started the C language in my university, so i would only like to ask you some simple questions!
1)supposing i write my program in dev-c++,(for example a program that writes to the screen the phrase hello world) then i press the compile button and the execute button, but nothing appears because everything happens so quickly! they told us to write the command system("pause")!Where sould i write this command and what should i do next?
2)another teacher told us to write the "setchar" command and then execute the program through the CMD prompt in windows. what exactly is that?
3)if i write the program in dev-c++ but i want to compile it in cygwin, shoule i save my program with a different name? or what sould i do?
4)everyone teaches us the command cc myprogram.c in order to compile a program!but in dev-c++ there is only a compile button!that means that here i don't need to use the cc.. command? where is it used? and where can i write that?
Any information would be useful, because i just started, and i find it pretty difficult..thanks in advance!

1. As the last line of your main() function.
2. You can also use getch() to wait for user to enter a character. Another way is to run your program from DOS prompt. That way, you can see the output even when it terminates, because you'll be still in the comand prompt mode.
3. save it with a name like myprog.cpp and then use it in other compiler.
4. in unix system, usually you type your program in a normal editor (like notepad) and then directly apply the compiler. cc is a compiler that assumes you have already typed your code in yourprog.cpp


All Answers

Answers by Expert:

Ask Experts




You may ask me about simple to complicated C/C++ programming methods/style and most like questions about network programming in C++.


I'm a professional programer in C++ and network/internet programming.

©2016 All rights reserved.