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

Pages: 1-

C Halp

Name: Hulio 2011-01-27 13:43

http://pastebin.com/QVkbT8AG

I'm attempting to pass an array from one function to a second where it will be filled with the current PATH, replacing colons with '/0/' characters.

I receive an error when trying to give the array a string, which I dont understand because when there is no secondary function and I do all the work in one class, it works perfectly.

Name: Anonymous 2011-01-27 13:44

Read K&R and go back to /g/.

Name: Anonymous 2011-01-27 13:47

>char pathlist[MAX_PATHS];
>printf("%s",pathlist[i]);
HIBT?

Name: Anonymous 2011-01-27 13:58

>>1
Read IHBT Haskell Beginner Tutorial.

Name: Anonymous 2011-01-27 14:05

I'm not trolling,
I'm new to C and this is a class project im working on.
I started with only the path()'s content in a main() with nothing else, and it worked fine.

I'm just confused as to why the assignment 'pathlist[i]=ch;'
doesnt work when I separate it into another function.


>>2
I know I haven't learned how to program well in c and plan on reading The C Programming language over the summer.

Name: Anonymous 2011-01-27 14:16

>>5
char pathlist[][]

char *ch is a pointer to char, but pointing to just one character would be stupid so it's commonly known as ``string''.

pathlist must be a pointer to pointers of char.

Name: Anonymous 2011-01-27 14:17

>>6
s/of char/to char/

Name: Anonymous 2011-01-27 14:19

>>5
Read it now, you goddamn imbecile cunt, before you anger someone you do not want to anger.

Name: VIPPER 2011-01-27 15:24

>>1
Halp
Eat JEWS

Name: Anonymous 2011-01-27 15:33

>>8
OKAY YOU JUST FUQIN ANGERED AN EXPERT PROGRAMMER

Name: Anonymous 2011-01-27 16:00

>>10
OKAY YOU NOTHING FUQIN ANGERED AN EXPERT NOMAD

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