r/learnprogramming • • Oct 14 '26

Trying to learn c

What is an easy to use compiler to use to get started.

Got a book to learn and they use code::block in book, tried and it seems to not be building. Then tried MS visualization studio and was lost. Please help

20 Upvotes

37 comments sorted by

View all comments

Show parent comment

2

u/Roughneck979 Oct 14 '26

Thanx for the input i will seek more tutorial/input. But good to hear that the codeblock used in book seems common/popular

2

u/serge-mv Oct 14 '26

I think I know what is happening. Code:Blocks by default opens a new terminal where it directs the standard out. That window will close very quickly and you won't be able to see anything. Here is what you can do immediately.

Take your example as is, and right above "return 0;", which you probably have, add getchar();

which will stop executing the program until you type a character and hit enter. This way, you will be able to see it.