Go Down

Topic: Combine multiple char * (Read 1 time) previous topic - next topic


Jan 05, 2013, 06:25 pm Last Edit: Jan 05, 2013, 06:27 pm by PeterH Reason: 1

So if you meant it to be an array of strings that happen to be initialized to 1 char, none of the solutions provided so far will work.

That is incorrect. Coding Badly provided an answer that does exactly what was requested.

If you meant it to be an array of chars, like:

Code: [Select]
char chars[16] = {'a', 'b', ..., 'p'};

then there is nothing to be done: chars is the pointer to a string.

You have neglected to null-terminate the string in your example.
I only provide help via the forum - please do not contact me for private consultancy.


That's a curious thing to want to do. Just out of nosiness, why do you want to do that?

Well actually it's for a cocoa application to unlock a PDF, but I needed some low-level advice in a short amount of time, so I asked here :)

I don't remember what I ended up doing (It's been a long weekend), but the program did what I needed and I'm done now haha

Thanks for all the help guys!
fuzzball27 >>-->

Go Up