Page 1 of 1
An issue with code::blocks and c
Posted: Thu Oct 29, 2009 9:39 pm
by ChrissyJ91
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:
Code: Select all
/* 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.
Re: An issue with code::blocks and c
Posted: Thu Oct 29, 2009 9:41 pm
by davidthefat
I think you need to just compile and run it yourself... Seems like its running the precompiled one from the last build
Re: An issue with code::blocks and c
Posted: Thu Oct 29, 2009 9:49 pm
by ChrissyJ91
thank you for the suggestion but it hasn't changed despite compiling and running it again.
Re: An issue with code::blocks and c
Posted: Thu Oct 29, 2009 9:51 pm
by davidthefat
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
Re: An issue with code::blocks and c
Posted: Thu Oct 29, 2009 9:59 pm
by ChrissyJ91
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.
Re: An issue with code::blocks and c
Posted: Thu Oct 29, 2009 10:04 pm
by 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
Re: An issue with code::blocks and c
Posted: Thu Oct 29, 2009 10:36 pm
by ChrissyJ91
. 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....
Re: An issue with code::blocks and c
Posted: Fri Oct 30, 2009 9:11 am
by MarauderIIC
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:
Code: Select all
/* 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.
Re: An issue with code::blocks and c
Posted: Wed Nov 04, 2009 6:22 am
by RyanPridgeon
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
Re: An issue with code::blocks and c
Posted: Wed Nov 04, 2009 10:57 am
by K-Bal
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.
Re: An issue with code::blocks and c
Posted: Wed Nov 04, 2009 4:14 pm
by JaxDragon
K-Bal wrote:I might be wrong but I've not heard anything from C::B for years, too.
They actually update it quite often, you just have to get it from their SVN.
Re: An issue with code::blocks and c
Posted: Wed Nov 04, 2009 4:48 pm
by K-Bal
Good to know, a new release wouldn't hurt
Re: An issue with code::blocks and c
Posted: Wed Nov 04, 2009 6:06 pm
by Kros
MarauderIIC wrote:I likes to recommend sum Microsoft Visual C++ Express.
Just adding a /signed to this ones right aboot here.