I want to turn an array of characters into ONE string.
Example:
char foo[2] = {'5', '0'}; --> char* foo = "50";
What would be the best way to go about doing this in C? The problem stems from a larger problem I'm having trying to extract a substring from command line input. For example, I want to make argv[1][0] and argv[1][1] into ONE string so that if the program was run like this...
$ ./foo 123456789
I could assign "12" to a char* variable.
{"5", "0"}meant to be{'5', '0'}or ischar foo[2]meant to bechar *foo[2]?