Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Atoi without minus
//gcc 5.4.0 #include <stdio.h> #include<stdlib.h> int myatoi(char *str) { int res=0; int i=0; int sign=1; if(str[0]=='-') { sign=-1; i++; } for(i=0;str[i]!='\0';++i) res=res*10+str[i]-'0'; return res*sign; } int main () { char str1[ ]="6"; char str2[ ]="5"; int number1=myatoi(str1); int number2=myatoi(str2); printf("%d\t%d\n",number1, number2); printf("%d",number1*number2); return 0; }
run
|
edit
|
history
|
help
0
Encriptado cesar
FILE_Access
Date
2.1.1 Prime numbers in different threads with thread ID
150109_RecursividadFactorial
MatrixMul_shortxshort
abc
length
C Pointers Experiment (So bad don't use)
Project 3 Part 1 v0.5