i'm trying to parse a string of digits that can be 1 to 3 chars long, but how to do this is eluding me.

would an isDigit method work? like this:

if(isdigit(vararray[v])){
			if(isdigit(vararray[v+1]) || vararray[v+1]==NULL){
				if(isdigit(vararray[v+2]) || vararray[v+2]==NULL){
					if(isdigit(vararray[v+3]) || vararray[v+3]==NULL){
						return;
					}
					return;
				}
				return;
			}
			return;
		}

but i get the warning: comparison between pointer and integer.

am i close to a solution for this problem?

> vararray[v+1]==NULL
Well if vararray is an array of char, then testing the nul character (as opposed to the NULL pointer) is what you should be doing.

As in vararray[v+1]=='\0'

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.