Newbie Reporting For Duty
1
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!
2
Name:
Anonymous
2009-08-27 18:59
1. Yes.
2. hax my anus
3
Name:
Anonymous
2009-08-27 19:01
>>1-2
A typical /prog/ thread in its natural habitat
4
Name:
Anonymous
2009-08-27 19:10
>>2
Yes.
Pointers are not strings, don't confuse the newbie!
>>1
Read K&R.
5
Name:
Anonymous
2009-08-27 19:11
Also, OP, look up >>argv<< to understand char ** in practice.
6
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!
7
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. わぁぁぁぁぁぁぁぁ!
8
Name:
Anonymous
2009-08-27 19:29
strings
stop calling them that, you'll only hurt yourself later on
9
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.
10
Name:
Anonymous
2009-08-27 19:33
Please use the [code] tags.
11
Name:
Anonymous
2009-08-27 19:33
>>8
>>9
Alright. Array of Chars!
>>11
Please optimize your quotes.
13
Name:
Anonymous
2009-08-27 21:44
14
Name:
Anonymous
2011-02-04 13:26