/* File Name : valsdec.c Student Name : Jason Gradziel Student Number : 826-135-535 Course Number : ISYS 291 Professor's Name : Brian Perry Lab Title : Assignment #1 Discription : int valsdec (char* decstr, int whole decs); decstr - is the string to be validated. whole - is the maximum number of digits before the decimal point. decs - is the maximum number of digits after the decimal point. */ #include int valunum (char* num); int valsnum (char* s); int valsdec(char* decstr, int whole, int decs) { char whole_num[41] = {'\0'}; char dec_num[41] = {'\0'}; int return_num = 0; int sign = 0; int count = 0; int flag=0; int num = 0; int whole_val = 0; int decs_val = 0; /* to check for null */ if (decstr[0] == '\0') { return_num = 11; strcpy(&decstr, NULL); return return_num; } /* to check if signed */ /* zero if not signed, one if signed */ if ((decstr[sign] == '+') || (decstr[sign] == '-')) sign++; if (sign == 0) /* not signed */ { /* loop for length of string */ for (count=0; count