Check if a string has only numbers in C?

前端 未结 5 984
予麋鹿
予麋鹿 2021-01-24 17:57

I\'m trying to write a simple code to check if a string only has numbers in it. So far it\'s not working, any help would be appreciated.

#include          


        
5条回答
  •  感情败类
    2021-01-24 18:38

    for(i = 0 ; i <= numbers ; ++i) //how is this supposed to work.
    

    Run the loop from 0 to 1 less than the length of the input.

    for(i = 0 ; i < strlen(numbers) ; ++i)
    

提交回复
热议问题