Created
April 3, 2016 10:43
-
-
Save dattaz/21e4849b2c1594747df974dac98184f6 to your computer and use it in GitHub Desktop.
what ?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
me@host:/tmp$ cat temp.c | |
#include <stdlib.h> | |
#include <stdio.h> | |
int main(){ | |
char temp[512] = "06:04,1"; | |
printf("%c %c %c %c\n",temp[0],temp[1],temp[3],temp[4]); | |
printf("%d %d %d %d\n\n",atoi(&temp[0]),atoi(&temp[1]),atoi(&temp[3]),atoi(&temp[4])); | |
return EXIT_SUCCESS; | |
} | |
me@host:/tmp$ ./a.out | |
0 6 0 4 | |
6 6 4 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
logique, atoi prend une chaine et s'arrete au premier caratères non numérique.