Last active
April 25, 2016 02:37
-
-
Save bzdgn/c0941309417c077c176b56b08c06321b to your computer and use it in GitHub Desktop.
strtol() Demo #2
This file contains hidden or 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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int main() | |
| { | |
| char * numbers = "12 156 101"; | |
| for (int i = 0; *numbers != NULL; i++) | |
| printf("%d : %ld\n", i, strtol(numbers, &numbers, 10)); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment