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

C pointer syntax

Name: Anonymous 2007-11-14 12:42

If I declare an array of arrays like this:

const char** p0 = { "##  ", "##  ", "    ", "    " };

I get these warnings:
type_d.h:13: warning: initialization from incompatible pointer type
type_d.h:13: warning: excess elements in scalar initializer
type_d.h:13: warning: (near initialization for ‘p0’)
type_d.h:13: warning: excess elements in scalar initializer
type_d.h:13: warning: (near initialization for ‘p0’)
type_d.h:13: warning: excess elements in scalar initializer
type_d.h:13: warning: (near initialization for ‘p0’)

but if I alter the syntax to

const char* p0[] = { "##  ", "##  ", "    ", "    " };

the warnings are all gone. what's exactly the difference between using * [] and ** ? I really thought they were just the same, just like * and [] or ** and [][].

If I did it like p0[][] = { ... would it be different at all?

Name: Anonymous 2007-11-18 18:32

>>33
An expression, simply to put, is anything that can be evaluated to a value.

Gimme a link or something.
Your C book.

I still don't understand, and am not willing to spend a lot of time thinking about this, so just tell me what you're getting at.
I don't care.

Lastly, to answer about the expresion 'A'

type: int
signedness: signed (okay saying signedness here is not correct, i should've asked whether it's a signed or unsigned type)
size: sizeof (int), equal or more than 1.

Anyway, you don't know C. that's all.

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