OK, thank you for the help. I changed what you said although i didnt quite understand this part--
> value = gav (mostunleetarray,1,4);
At least make the parameters consistent with the array you're passing.
As it stands, you're off in no-mans land
I supose it has somthing to do with the new problem....
Code:
#include <fstream.h>
#include <iostream.h>
#include <stdlib.h>
#include <string.h>
char * gav (char * arg[], int start, int end) {
char * z;
char * x;
x = new char[1024];
*x = '\0';
while (start < end) {
z = arg[start-1];
strcat (x,z);
start++;
}
return x;
}
int main ()
{
char * mostunleetarray[] = {"workyou"};
char * value;
value = gav (mostunleetarray,1,4); //why does it not take the first 4 charactors?
cout << value << "\n";
//it prints 'workyou' and some oher garble, why not just the charactors 1 to 4? ('work')
system ("PAUSE");
return 0;
}