Z
Zahpod
Hi all
The Code:
#include <stdio.h>
#include <sys/ddi.h>
main(int argc, char *argv[])
{
int i,dec;
if ( argc < 2 )
{
printf("\nBitte eine oder mehrere Zahlen als Argument angeben!");
printf("\nBeispiel:");
printf("\n %s 10 1 12 132\n",argv[0]);
return 2;
}
for (i=1; i<argc; i++)
{
dec = stoi(argv);
printf("%s = %4d = %4x\n", argv, dec, dec);
//printf("%s\n", argv);
}
return 0;
}
The problem:
$ gcc dec2hex.c
Undefined first referenced
symbol in file
stoi /var/tmp//ccepw0WS.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status
The Code:
#include <stdio.h>
#include <sys/ddi.h>
main(int argc, char *argv[])
{
int i,dec;
if ( argc < 2 )
{
printf("\nBitte eine oder mehrere Zahlen als Argument angeben!");
printf("\nBeispiel:");
printf("\n %s 10 1 12 132\n",argv[0]);
return 2;
}
for (i=1; i<argc; i++)
{
dec = stoi(argv);
printf("%s = %4d = %4x\n", argv, dec, dec);
//printf("%s\n", argv);
}
return 0;
}
The problem:
$ gcc dec2hex.c
Undefined first referenced
symbol in file
stoi /var/tmp//ccepw0WS.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status