this is a program for splitting numbers from letters, the only problem i have is that it doesnt count any after it finds a lettre.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
int size;
printf("Enter a string of letters and numbers.\n");
char string[50];
scanf("%s", string);
size = strlen(string);
printf("\nYour string is %d byt%s long...\n", size, (size==1 ? "e" : "es"));
printf(" ... and contains %d characters\n\n", size);
printf("string = %d\n", atoi(string));
return 0;
}
ie, input: 51516fef54, and the output will be 51516 (leaves the 54). how do i make it find the 54 at the end?
Brad.