In that case I would use a while loop instead of a for loop. Perhaps something like this works (I haven't tested it):
Code:
StrLength = strlen (wholeP);
NonDigitFound = FALSE;
Counter = 0;
while (NotDigitFound == FALSE && Counter < StrLength)
{
if (!isdigit (wholeP [Counter]))
NotDigitFound = TRUE;
}
if (NotDigitFound == FALSE)
stk->wholesaleprice= atof(wholeP);
In C a variable declared in a function is local. That means that the variable is known in the function in which it is declared and it is not known by the other functions.
So the variable sta you declared in main() is not known by ShowData(). If you want ShowData to print the contents of sta, you need to pass that variable to the function.
Function main() should be of type int and return a return-value, this value tells the environment how the program finished. Usually 0 is OK and 1 is ERROR. The environment can be a programm which calls your program or the OS.