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

copy an array in c

Name: Anonymous 2007-03-12 22:30 ID:016HOAcL

I have a function, it accepts a char**, what is the quickest and most efficient way of making a local copy of the array in the function scope?

That is, i have , for example:

void funk(char **x){

char **b;

/*How do i make a separate copy of x to b?*/
}

Take pity on me internets, I'm a noob :) Thanks.

Name: Anonymous 2007-03-14 23:12 ID:1w3ZGCoJ

>>31
- Non-binary safe.
why do strings need to be binary safe? only an idiot would store anything other than ascii or utf-8 text in a string.

- O(n) length.
- Twice as expensive concatenation.
- Hinders possible word transfer optimizations for O(n) operations.
if you're working with strings so long you even notice those you're doing something wrong.

- More easily exploitable (e.g. Windows registry entries with null characters in their names, possible in Win32 but hidden from regedit.exe from being written in C).
i can write shitty code in python/ruby/haskell/whatever language you think is superior, too.
just because microsoft can't convince anyone with more than e^(i/(2ln(i^i)+pi)) brain cells to work for them...

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