#Any books that cover GCC?

36 messages · Page 1 of 1 (latest)

dire bobcat
#

Hello everyone, i jsut started studying C by myself. Any books that cover C with GCC? i found a few books that use some other compilers, more specifically from MS-DOS. I want GCC because it is POSIX. Yes, i'm aware that there are YouTube tutorials. that's what i am watching rn.

winter birchBOT
#

When your question is answered use !solved or the button below to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

west pelican
#

Have to ask. Do you think C will be wildly different with gcc?
When compared with other compilers, I mean.

#

There will be very niche differences, like some headers only being available on POSIX systems and vice versa.
But these headers fall outside the C standard anyway, and I doubt that any book on gcc - if one exists - would go into detail about these headers.
After all, you can compile with gcc on Windows too.

dire bobcat
#

My code would not compile because of some issues

#

My book told me to void main{
return 0;
}

#

That was wrong

#

It didn't compile

west pelican
#

Are you sure it was just

void main{
    return 0;
}

And not:

void main() {
    return 0;
}
dire bobcat
#

It was main()

#

And still didn't work

#

But when I did int main(), it worked fine

west pelican
#

Okay, this is not per sé about gcc.
This is probably more about how "permissive" Microsoft compilers worked back in the day.

dire bobcat
#

Also my compile freaked out at getch();

west pelican
#

So your question is legit.
Even though it doesn't need to be gcc specifically.

dire bobcat
#

Also, the book told me to #include <conio.h>

#

It also returned error of non existence

#

So I started studying C by YouTube Tutorials

#

Okay, I actually found a book that doesn't get into weird situations.

west pelican
#

Close that other book, for sure.

dire bobcat
#

Yeah

#

I can also use YouTube Tutorials for a bit

#

Seems like C has changed. It's not the same for every system ever

west pelican
#

Well, yes and no.
Function main() always returned an int.
But the standards have indeed evolved over the years since that book of yours.

Stick with gcc as you set out.
But consider turning on compiler warnings to help you stay within standards.

Example:

gcc main.c -Wall -o myapp.exe

See this: https://godbolt.org/z/M8c58veca

If you remove the -Wall option, then you will see that even gcc is permissive.

pseudo mesa
#

Reading the above it seems like the OP is more interested in an overall tutorial?

If thats the case this server has an incomplete one somewhere

#

As for actually learning C - I suggest picking up a book or a good (paid) course. I, personally have yet to see a good YT tutorial (of C) yet

lapis pagoda
#

on the other hand even ancient K&R one would work, although needing -ansi to gcc

#

it is specifically on C and gcc

#

for sure the book uses a horrible gnu way of formatting of C source, which comes straight from hell :P

craggy tiger
#

Terry A. Davis get's a phone call video

meager musk
#

oh mb it wasnt you