Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C, pointers and strings

Name: Anonymous 2011-11-06 5:10

Okay, I get this much:
C does two kinds of memory management: Manual allocation from the heap (malloc, free) and automatic allocation from the stack.

Most functions take char pointer arguments instead of a char array as the string. Additionally, it seems pointers and array share a very odd relationship, so that x[y]=y[x].

What would be a good way to familiarize myself with the concepts of C and its way of dealing with memory? Jumping into the cold water, try to get as far as possible and learning by segfault or is there decent literature on the topic?

Name: Anonymous 2011-11-06 16:16

>>1
>>4
not confusing enough yet
x[y] is equvialent to *(x+y)

no decent literature will save you from hours of stackfucks, segfaults and stray pointers with no pointees, some things need to be experienced

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List