Hi. I am not a C programmer but I need to complete my little C program which will run on Unix (HP-UX). I need to take all passed arguments into a single string and get its length.
Arguments may look like this:
Uranus 3100 This is a test;0;0;Group A;Group B
The first 2 arguments must stay as argv[1] and argv[2] but the remaining of the line must be inserted into a single string and get is caracter count.
So, what I did up to now is this:
main(argc, argv)
int argc;
char *argv[];
{
int i;
int nbr;
char *ret;
for (i = 3; i < argc; i++)
{
ret = strcat(ret,argv);
}
nbr = sizeof(ret);
}
Can someone tell me what's wrong? (As I said, I am far from being a C specialist; I am a VB specialist and I didn't use C since 10 years!).
Thanks for your help.
Arguments may look like this:
Uranus 3100 This is a test;0;0;Group A;Group B
The first 2 arguments must stay as argv[1] and argv[2] but the remaining of the line must be inserted into a single string and get is caracter count.
So, what I did up to now is this:
main(argc, argv)
int argc;
char *argv[];
{
int i;
int nbr;
char *ret;
for (i = 3; i < argc; i++)
{
ret = strcat(ret,argv);
}
nbr = sizeof(ret);
}
Can someone tell me what's wrong? (As I said, I am far from being a C specialist; I am a VB specialist and I didn't use C since 10 years!).
Thanks for your help.