📝 Added sandbox (code sketchbook)
This commit is contained in:
parent
b475595f7f
commit
b5daf18b1a
142 changed files with 100702 additions and 0 deletions
19
sandbox/atoi.c
Normal file
19
sandbox/atoi.c
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/* https://www.tutorialspoint.com/c_standard_library/c_function_atoi.htm */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int main() {
|
||||
int val;
|
||||
char str[20];
|
||||
|
||||
strcpy(str, "98993489");
|
||||
val = atoi(str);
|
||||
printf("String value = %s, Int value = %d\n", str, val);
|
||||
|
||||
strcpy(str, "tutorialspoint.com");
|
||||
val = atoi(str);
|
||||
printf("String value = %s, Int value = %d\n", str, val);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue