hi
can anyone send me a perfect date validation routing and string validation routine in C
thanks
raajesh
hi
can anyone send me a perfect date validation routing and string validation routine in C
thanks
raajesh
Shouldn't you be doing your own homework? String validation? That's easy. strcmpOriginally posted by rajesh23
hi
can anyone send me a perfect date validation routing and string validation routine in C
thanks
raajesh
Quzah.
Hope is the first step on the road to disappointment.
hello
u dint get my question right. I want to find whether the input is a string or not. What u gave is string verification and not validation?
raajesh
>I want to find whether the input is a string or not.
Ah, easy questions! All input is a string, problem solved! As long as you don't use one of those nasty little buggers like *scanf or fread you can be pretty darn sure that you've got a string until you decide to convert it to something else. Next question!
The information given in this message is known to work on FreeBSD 4.8 STABLE.
*The above statement is false if I was too lazy to test it.*
Please take note that I am not a technical writer, nor do I care to become one.
If someone finds a mistake, gleaming error or typo, do me a favor...bite me.
Don't assume that I'm ever entirely serious or entirely joking.
Question: What is a string? Its a array of numbers (ascii values). So a string verifier doesn't make sense. Plus your using c so you will declare a string if you except use input (other then numbers unless you want) so it will be a string. So unless i am missing something there is something your not saying.
>Its a array of numbers (ascii values).
Close. In C a string is an array of characters (printable interger values) ending with \0. And don't go assuming ASCII either, some wierdos actually use other character sets.
The information given in this message is known to work on FreeBSD 4.8 STABLE.
*The above statement is false if I was too lazy to test it.*
Please take note that I am not a technical writer, nor do I care to become one.
If someone finds a mistake, gleaming error or typo, do me a favor...bite me.
Don't assume that I'm ever entirely serious or entirely joking.
No I didn't. You didn't make yourself clear. You said you wanted to validate a date and a string.Originally posted by rajesh23
hello
u dint get my question right. I want to find whether the input is a string or not. What u gave is string verification and not validation?
raajesh
First off, your string question doesn't make sense at all. Input is whatever you read it as. Nothing more, nothing less.
If you read input as numbers, it's numbers. If you read it all into a buffer and call it a string, then it's a string.
So basicly you wanted to know how to read a string. If you can't even do that, you should start over in your C book. If you know how to do that, then why on earth are you asking how to?
You didn't specify anything more than "string validation". Everything can be a string. It's up to you to make it more. You use input routines that give you numbers, characters, or whatever.
Furthermore, you didn't say if you where you were reading from. Any "string" input can also be simply a bunch of numbers.
Consider:
input: "abcd"
This can be a string of "abcd", or, it could be one 32 bit number, depending on how much you're reading, and how you read it.
fread( &longint, sizeof( long int ), 1, inputstream );
There you go. Now "abcd" is a single long integer. Input is whatever you want it to be. They're all bits and bytes.
Quzah.
Hope is the first step on the road to disappointment.
>>some wierdos actually use other character sets.
Oi ! I take that personally
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
>Oi ! I take that personally
You'll recover.
The information given in this message is known to work on FreeBSD 4.8 STABLE.
*The above statement is false if I was too lazy to test it.*
Please take note that I am not a technical writer, nor do I care to become one.
If someone finds a mistake, gleaming error or typo, do me a favor...bite me.
Don't assume that I'm ever entirely serious or entirely joking.