-
atoi
Hello, my project calls for using nested loops only to accept, validate and
convert date(yyyymmdd) to european and us format style(dd/mm/yyyy and mm/dd/yyyy).
we cannot use atoi to do this. my question is; how do i convert this to
a numeric value?
-
Re: atoi
"Mikal" <kmpg@earthlink.net> wrote:
>
>Hello, my project calls for using nested loops only to accept, validate
and
>convert date(yyyymmdd) to european and us format style(dd/mm/yyyy and mm/dd/yyyy).
> we cannot use atoi to do this. my question is; how do i convert this to
>a numeric value?
>
>Hi, I'm Alex look how I'd do that:
if the data is a numeric value (no caracters) how I wonderstand:
int dd=0,mm=0,yyyy=0,date;
char eur[11];
dd=date%100;date\=100;
mm=date%100;date\=100;
yyyy=date;
eur[0]=dd;
eur[1]='/';
eur[2]='mm';
eur[3]='/';
eur[4]=yyyy
I don run this code bur the ideea is to chop the number with div and mod
operators and put them into an array, and after that to test the array's
components
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|