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

Pages: 1-

Newbie Reporting For Duty

Name: Anonymous 2009-08-27 18:53

I have two C questions:

1. "char **e;" Would this be a pointer to a pointer to a char? So basically, a pointer to a string?

2. "char **i[5];" and "char (*g)[3];" What is those?

In before "homework". It's not. It's personal interest!

Name: Anonymous 2009-08-27 18:59

1. Yes.

2. hax my anus

Name: Anonymous 2009-08-27 19:01

>>1-2
A typical /prog/ thread in its natural habitat

Name: Anonymous 2009-08-27 19:10

>>2
Yes.
Pointers are not strings, don't confuse the newbie!
>>1
Read K&R.

Name: Anonymous 2009-08-27 19:11

Also, OP, look up >>argv<< to understand char ** in practice.

Name: Anonymous 2009-08-27 19:15

>>2
>>4

So this would be a correct statement:
char *hax = "Hax My Anus";
char **anus;
anus = &hax;
printf("%s\n", *anus);

Ok.

>>4
>>5

I will look up argv. Just tell me what it is!

Name: Anonymous 2009-08-27 19:25

char *anus = "Hax My Anus";
char *prog = "prog owns";
char **string[2];
string[0] = &anus;
string[1] = &prog;
printf("%s\n", *string[0]);
printf("%s\n", *string[1]);

I see. Array of pointers to strings. I am getting there. わぁぁぁぁぁぁぁぁ!

Name: Anonymous 2009-08-27 19:29

strings
stop calling them that, you'll only hurt yourself later on

Name: Anonymous 2009-08-27 19:30

>>8
Agreed. C does not support strings except as literals; once you need to actually do something with a string, you have to reinvent the wheel string.

Name: Anonymous 2009-08-27 19:33

Please use the [code] tags.

Name: Anonymous 2009-08-27 19:33

>>8
>>9

Alright. Array of Chars!

Name: Haxus the Etiquette Advisor 2009-08-27 21:18

>>11
Please optimize your quotes.

Name: Anonymous 2009-08-27 21:44

>>1-
EXPERT QUOTER

Name: Anonymous 2011-02-04 13:26


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