i have this code:
int main(int argc, char* argv[])
{
remove(debug_file);
count=0;//count d number of seeding
for (int i = 1; i < argc; i++)
{
/* Check for a switch (leading "-") */
if (argv[i][0] == '-')
{
/* Use the next character to decide what to do. */
switch (argv[i][1])
{
case 'i': strcpy (input_file,argv[++i]);
printf ("Input file = %s\n", input_file);
break;
case 'o': strcpy (output_file,argv[++i]);
printf ("Output file = %s\n", output_file);
break;
case 's': strcpy (seed,argv[++i]);
strcpy (seed_array[count],seed);
seeding();
count++;
break;
default: printf ("Invalid selection \n");
break;
}
}
}
CleanUp();
printf ("Running Completed......\n");
getch();
return 0;
}
lets say i have this parameter:
-i fruit.flt -o out -t 2 -s flower, -s oren, -s banana,
there r 3 type of seeds:flower,oren and banana which r need to be written in output file.before that, i have to process the data in seeding() function.because of the system found 3 times of -s, the function seeding() entered 3 times.what should i do if i want the system enter the function seeding() only once after the 3rd -s (banana) is processed.means,when count=3 then only go to fucntion seeding().
really blur