structure-string

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pointers
    New Member
    • Oct 2006
    • 9

    structure-string

    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("0207198 4") 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.
Working...