Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. char* GetNumFromStr(char* tempBuff, int strSize, int i)
  2. {
  3.   static char numFromStr[1024];
  4.  
  5.   for (int i1 = i; ; i1++)
  6.   {
  7.     if (!isdigit(tempBuff[i1]))
  8.     {
  9.       return 0;
  10.     }
  11.  
  12.     static char singleNum[1024];
  13.     sprintf(singleNum, "%c", tempBuff[i1]);
  14.     strcat(numFromStr, singleNum);
  15.  
  16.     if (!isdigit(tempBuff[i1 + 1]))
  17.     {
  18.       return numFromStr;
  19.     }
  20.   }
  21.  
  22.   return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement