I'm new to programming. What I want is to know as much about programming as I possibly can, and start off with what people say is a good start: programming with C.
I have this PDF called "Teach Yourself C In 21 Days" and it looks to be a rather simple introduction to the language. I swapped Windows 7 for Ubuntu yesterday, after having trouble installing it for over 12 hours (post I made regarding the issue). The main reason why I came to Ubuntu is to dive into an OS made for people wanting to learn how to develop software or even a new OS, like Steam's new OS based off Linux. The problem I'm facing, though, is that there seems to be some functions that don't translate with Ubuntu's Terminal (I followed instructions similar to this post to get started).
What I'm asking is whether or not there is some way I can look up corresponding functions used in C programming for gcc? Or is there a PDF or website that teaches C/C++ through gcc?
I will also accept recommendations for where/how/what I SHOULD start learning.
I figure my question can be better answered if I include the actual problem I have. The PDF has this exercise:
- What does the following program do? (Enter, compile, and run it.)
1:-- /* EX2-5.C */
6:-- char buffer;
8:-- printf( "Enter your name and press :\n");
9:-- gets( buffer );
11:-- printf( "\nYour name has %d characters and spaces!",
12:-- strlen( buffer ));
14:-- return 0;
I found out that in order to do some simpler code from earlier exercises, I needed to add 'int' in front of 'main' for it to work. So imagine that being added to the code. The error I get when I try to check for the errors is as follows:
EX2-5.c: In function ‘main’:
EX2-5.c:9:2: error: ‘gets’ is deprecated (declared at /usr/include/stdio.h:638) [-Werror=deprecated-declarations]
EX2-5.c:12:4: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘size_t’ [-Werror=format=]
cc1: all warnings being treated as errors