[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
[an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]![]() |
![]() |
![]() |
|||||||||||||||||||||||||
|
|||||||||||||||||||||||||||
![]() |
![]() |
![]() |
Hi. > funktionen atoi hvad gør den egentligt?? Sikrer at en > given input ER en integer eller?? Konverterer den del af en streng som er et tal, til et tal.. ehem. altså.... #include <stdio.h> #include <stdlib.h> #include <unistd.h> int main() { char string1[]="123abc"; char string2[]="abc123"; char string3[]="abc"; char string4[]="123"; printf("%s: %d\n",string1,atoi(string1)); printf("%s: %d\n",string2,atoi(string2)); printf("%s: %d\n",string3,atoi(string3)); printf("%s: %d\n",string4,atoi(string4)); return 0; } output: 123abc: 123 abc123; 0 abc: 0 123: 123 bean
![]() |
![]() |
![]() |
||||||||||||
|
||||||||||||||
![]() | ||||||||||||||
|
||||||||||||||
![]() |
![]() |
![]() |