I am now trying to figure out how to read more than 1 command line argument into a buffer that is just one string. Is this possible? Do I have a chance. This is all I have left and then I graduate in 2 weeks. All your help is really appreciated.
I am now trying to figure out how to read more than 1 command line argument into a buffer that is just one string. Is this possible? Do I have a chance. This is all I have left and then I graduate in 2 weeks. All your help is really appreciated.
You know how to cycle through the command line arguments right? Use a for loop and go until you get to whatever argc is.
You know how to stick two strings together right? Use strcat or strncat.
That's all you need.
Or you could do it this way:
Because stdout is buffered. So technicly...Code:#include<stdio.h> int main(int argc ,char*argv[]){int x;for(x=0;x<argc; x++)fprintf(stdout ,"%s",argv[x]); return 0;}
Quzah.
Hope is the first step on the road to disappointment.
I had forgotten about strcat. I got it though. Thanks.