how to convert string to integer in c
#include <stdio.h>
#include <stdlib.h>
int main()
{
char ch[]="123";
int a=atoi(ch);
printf("%d",a);
return 0;
}
how to convert string to integer in c
#include <stdio.h>
#include <stdlib.h>
int main()
{
char ch[]="123";
int a=atoi(ch);
printf("%d",a);
return 0;
}
convert string to int c
const char *number = "10";
char *end;
long int value = strtol(number, &end, 10);
if (end == number || *end != '\0' || errno == ERANGE)
printf("Not a number");
else
printf("Value: %ld", value);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us