strcpy((char *) uid.arr,argv[1]); [message #162152] |
Thu, 09 March 2006 00:18 |
surbhigarg
Messages: 11 Registered: January 2006
|
Junior Member |
|
|
hi
i m trainee and i m reading a pro*c code.
they have used "strcpy((char *) uid.arr,argv[1]);"
can any one tell-->
why do we use "strcpy((char *) uid.arr,argv[1]);"
why we use uid.arr instead cant we use directly "strcpy(uid,argv[1]);"
thanks
surbhi
|
|
|
Re: strcpy((char *) uid.arr,argv[1]); [message #169770 is a reply to message #162152] |
Fri, 28 April 2006 11:07 |
denis.flotat
Messages: 13 Registered: September 2005
|
Junior Member |
|
|
Because each VARCHAR2 field in oracle database is defined as a VARCHAR in PRO*C.
In fact it is a host structure that is defined by 2 fields :
- arr : string content (null terminated)
- len : specify length of string
when you want to insert a string you need to fill .arr structure then update .len (=strlen(xxx.arr)).
Regards.
|
|
|