Hello, I am trying to teach myself c using the book "Absolute beginners guide to c by Greg Perry" but have run into some problems. The very first program he gives you is a simple printf program which I have displayed here:
/* Prints a mesage on the screen */
#include <stdio.h>
int main()
{
printf("this c stuff is easy!");
return 0;
}
however when I compile this code in code::blocks it runs however the output text (in fact any output text as I have tried changing it) is changed to "hello world"
I'm not sure if anyone has experienced this problem and or knows how this can be resolved? any help would be appreciated.
ChrissyJ91 wrote:thank you for the suggestion but it hasn't changed despite compiling and running it again.
Its probably the settings on code::blocks... I dont use Code::blocks so I cant help you, try using devc++ http://www.bloodshed.net/devcpp.html its an all c/c++ ide, so it should fix your problem
I have dev c++ I stopped using it after I found that the console window only opens for a split second and then closes. I'm sure that there is at least one command I can use to keep it open but I'm not sure what it or they might be.
edit: fixed it using getchar(); so it wil wait for user input before closing. sweet. I think I've found my compiler. thanks for the help davidthefat.
ChrissyJ91 wrote:I have dev c++ I stopped using it after I found that the console window only opens for a split second and then closes. I'm sure that there is at least one command I can use to keep it open but I'm not sure what it or they might be.
edit: fixed it using getchar(); so it wil wait for user input before closing. sweet. I think I've found my compiler. thanks for the help davidthefat.
No Problem, I been there done that, not Im a noob in the world of GUI
. I'm really amped now I can actually make some progress in a book that I can actually understand although it is half three in the morning... actually... sleep can wait....
ChrissyJ91 wrote:Hello, I am trying to teach myself c using the book "Absolute beginners guide to c by Greg Perry" but have run into some problems. The very first program he gives you is a simple printf program which I have displayed here:
/* Prints a mesage on the screen */
#include <stdio.h>
int main()
{
printf("this c stuff is easy!");
return 0;
}
however when I compile this code in code::blocks it runs however the output text (in fact any output text as I have tried changing it) is changed to "hello world"
I'm not sure if anyone has experienced this problem and or knows how this can be resolved? any help would be appreciated.
Looking like you did something like compile the active project which has "hello world" but you didn't add your new file to it, or something.
I heard Dev-C++ isn't supported anymore? Not sure? I likes to recommend sum Microsoft Visual C++ Express.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
Code::Blocks is pretty much the newer, better, still in production version of Dev C++. So I recommend you go back to Codeblocks and figure out what you did wrong, because you may be limited in the future if you stick to Dev Cpp :P
Ryan Pridgeon C, C++, C#, Java, ActionScript 3, HaXe, PHP, VB.Net, Pascal Music | Blog
RyanPridgeon wrote:Dev C++ has been abandoned for years.
Code::Blocks is pretty much the newer, better, still in production version of Dev C++. So I recommend you go back to Codeblocks and figure out what you did wrong, because you may be limited in the future if you stick to Dev Cpp :P
I might be wrong but I've not heard anything from C::B for years, too.
I would recommend using Qt Creator, which has some great features and is actively developed.