muser wrote:[color=blue]
>
> Juan i get the feeling you've misunderstood me.[/color]
I don't think so.
[color=blue]
> I want the function to
> return true, not false.[/color]
OK.
Then write the function the way you want it to behave.
At the moment you wrote your function such that it always
returns false. If this is not what you ment, rewrite the function.
But: Start with *indenting* your code !!!!!
A lot of troubles come from the fact, that your code right now
is unreadable. In order to analyze it, one needs to reindent it.
Well, if we need to reindent it, in order to analyze it, then
you definitly have to reindent it!
[color=blue]
> the for( i= 1; i<=2; i++) surely that
> increments to the next element in the array?
> That was the whole
> thinking when I wrote the code.
> The exact problem I'm having is that this function is not picking up
> the fact that the line it is suppose to be reading does start with a
> digit: i.e. 12sceptrerd.[/color]
The exact problem is that your function doesn't do what you think it does.
At the moment, as it is written now, your function does exactly:
bool checkdigitsinaddress( const char* string )
{
for( int i =0; i<=1; i++ )
if( !isdigit( string[i] ))
{
}
return false;
}
and nothing else.
Proper indentation shows this very clearly.
[color=blue]
> I want the line from the file I'm reading, to
> be valid, to check that the program i've written is correct.
> As my original post quite clearly implies if you can help please do.[/color]
I still think you need to learn a lot before you can even think about
solving that exact problem. You try to swallow to much.
--
Karl Heinz Buchegger
kbuchegg@gascad.at