By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,227 Members | 1,290 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,227 IT Pros & Developers. It's quick & easy.

structure-string

P: 9
Hi,
I hav defined an array of n elements.Each element represents a structure. Like,

typedef struct
{
int dd;
int mm;
int yyyy;
}srik;
srik a[n];
Then how to assign a date (eg:02/07/1984) as a string("02071984") to the first array element(means the first structure) in the array.
I thought .
scanf("%s",a[0]);
/*here the input given is "02071984"*/
But it is not working......
if i print ( printf("%s",a[0]) ) it is showing garbage value...........
Could U please suggest me the right procedure for the problem.

Thanks & Regards.
Nov 5 '06 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.