400000000000;499999999999;VISA;
50000000;59999999;MASTERCARD;
67000000;67999999;MAESTRO;
fields: 1. Range Start 2. Range End, 3 Name.
[Start Range] and [End Range] fields can be from 1 to 16 characters (digits) in length.
The program's objective is as follows:
First Request to enter 16-digit card number.
Card number input, verification and processing use char [n] type (Simbol array)
Second:Check for an entry corresponding to the entered card number can be found in a text file if I enter 45000000000 it's between 400000000000 and 499999999999 so i need to put a text in a autput name VISA. And i can't use long long types... as i undrstand i need to use arrays... Third Request to enter the amount in the format "nnnn.mm", where nnnn-1 to 4 digits long amount of lats, but mm - 2-digit amount santims.
char input[32]; // = "100;200;first";
char name[10];
int min, max, c, i, k;
FILE *file;
file = fopen("gg.txt","r");
i=0;
while ((c=getc(file))!= EOF)
{
k=(int)c;
input[i]=k;
i++;
}
char* result = NULL;
char delims[] = ";";
result = strtok(input, delims);
// atoi() converts ascii to integer.
min = atoi(result);
result = strtok(NULL, delims);
max = atoi(result);
result = strtok(NULL, delims);
strcpy(name, result);
printf("Min=%d, Max=%d, Name=%s\n", min, max, name);
printf("input=%s\n",input);
printf("%d\n",i);
getch();
return 0;
this code given me by varunl works vith smal numbers ( the containing of gg.txt file is: 100;200;first), but a need smt else, enybody, can help me?