Code::Blocks Forums
User forums => Help => Topic started by: bradpetrelli on November 24, 2010, 09:50:42 pm
-
Welcome all,
I'll start with information that I'm absolutely new with programming in C++. But I want to start with CodeBlocks and i have problem on very beginning because i try to "copy - paste" first program doing everything step by step with manual for dummies... :)...
#include <cstdio>
int main()
{
printf( "Test Code::Blocks" );
return 0;
}
this can't be wrong :), but when I'm trying to press Ctrl+F9 or button "Build and run" I'have no respond...
I know that this can mean everything but maybe someone had similar problem...
I have last version of CodeBlocks and Windows7 ...
Please for help and big thanks for all answers.
-
What kind of response do you expect from the system running this program?
Well, actually it's quite simple. Your program just runs and exists without any errors.
If you expect to see a console window with output of your "hello world", insert following line
at the beginning of your program and
just before "return 0"
to force your program to wait until you press a key after it finishes its work.
Also, it has no connection to Code::Blocks at all.
-
How I have:
#include <cstdio>
int main ()
{
printf( "test" );
getchar();
return 0;
}
and still no respond from CB... also nothing in Build log... i don't have any window, any exe file any respond...
-
Are you sure you have a compiler installed and set it up correctly ?
-
can you give me some solution how I can check it ? :) I'm total n00b ... sorry... everyone was on beginning once :)...
-
Read the manual, read the FAQ in the wiki, read the forum rules and search a bit in the forum...
Being a nOOb is not an excuse for being lazy...
-
Hi bradpetrelli,
I was able to get this code to compile, link and run by adding the 'using namespace std;' statement to the code. Below is the code sample with the added statement at line 2.
1. #include <cstdio>
2. using namespace std;
3.
4. int main()
5. {
6. printf ( "Test Code::Blocks" );
7. return 0;
8. }
If this information did not help you, or if I am misunderstanding your question, please make another post. I will check back.