Hi
I have tried to compile the code below with the following command on hpux - cc -Aa -o ouput.exe myproc.c
code :
#include <stdlib.h>
envvar=getenv("TERM"
;
printf("The value for the environment variable TERM is "
;
if(envvar)
{ printf("%s\n",envvar); }
else { printf("not set.\n"
; }
}
After i try to compile i get the following message :
# cc -Aa -o ouput.exe myproc.c
cc: "myproc.c", line 2: warning 557: Missing declaration specifiers, "int" assumed.
cc: "myproc.c", line 2: error 1521: Incorrect initialization.
cc: "myproc.c", line 3: error 1000: Unexpected symbol: "The value for the environment variable TERM is ".
cc: "myproc.c", line 4: error 1000: Unexpected symbol: "if".
cc: "myproc.c", line 3: warning 557: Missing declaration specifiers, "int" assumed.
cc: "myproc.c", line 3: error 1506: Parameters allowed in function definition only.
cc: "myproc.c", line 6: error 1000: Unexpected symbol: "else".
cc: "myproc.c", line 6: error 1000: Unexpected symbol: ";".
Could anyone please advise me where i am going wrong.
Regards
Simon
Simon Peter Wickham
Email: s.wickham@zoom.co.uk
I have tried to compile the code below with the following command on hpux - cc -Aa -o ouput.exe myproc.c
code :
#include <stdlib.h>
envvar=getenv("TERM"
printf("The value for the environment variable TERM is "
if(envvar)
{ printf("%s\n",envvar); }
else { printf("not set.\n"
}
After i try to compile i get the following message :
# cc -Aa -o ouput.exe myproc.c
cc: "myproc.c", line 2: warning 557: Missing declaration specifiers, "int" assumed.
cc: "myproc.c", line 2: error 1521: Incorrect initialization.
cc: "myproc.c", line 3: error 1000: Unexpected symbol: "The value for the environment variable TERM is ".
cc: "myproc.c", line 4: error 1000: Unexpected symbol: "if".
cc: "myproc.c", line 3: warning 557: Missing declaration specifiers, "int" assumed.
cc: "myproc.c", line 3: error 1506: Parameters allowed in function definition only.
cc: "myproc.c", line 6: error 1000: Unexpected symbol: "else".
cc: "myproc.c", line 6: error 1000: Unexpected symbol: ";".
Could anyone please advise me where i am going wrong.
Regards
Simon
Simon Peter Wickham
Email: s.wickham@zoom.co.uk