Hi guys I m trying my hand on some program::where there is a function like this::

void IVR_AL_GET_VM_RETRIEVAL_PROFILE_REQ(ds *pline, char xmlToken[e_LASTCOUNT][5000])
{
   strcpy(xmlToken[e_MESSAGETYPE],"GET_VM_RETRIEVAL_PROFILE_REQ");
     strcpy(xmlToken[e_MSISDN],pline->user_info.msisdn);
     strcpy(xmlToken[e_TRANSACTION_ID],pline->transactionId);

     return;
}

where ds and user_info are structures::

struct user_info
{
int msisdn;
char redirReason[17];  //Used in GET_VM_DEPOSIT_PROFILE_REQ
char *caller_no; //To be used in GET_VM_DEPOSIT_PROFILE_REQ (not used in the called code)
char *availMsgId;     //used in SUBMIT_VM_MSG_REQ
char subReqType[13]; //Msg category used inside SUBMIT_VM_MSG_REQ function
char msgPriority[16]; //Used in SUBMIT_VM_MSG_REQ
int frndListId;  /*Id of the friendlist in which number is to be added or deleted used in function 					   ADD_NUM_IN_FRNDLIST_REQ and DEL_NUM_FROM_FRNDLIST_REQ*/
char *currNum;  /*Number to be added or deleted from/to  friendlist used in ADD_NUM_IN_FRNDLIST_REQ ,					DEL_NUM_FROM_FRNDLIST_REQ, ADD_CALLER_GREET_REQ,DEL_CALLER_GREET_REQ */
char *welToneId; /*Used in UPDATE_DEF_GREET_REQ, DEL_DEF_GREET_REQ, ADD_CALLER_GREET_REQ, DEL_CALLER_GREET_REQ, 				DEL_MSG_REQ, SAVE_MSG_REQ,LISTEN_MSG_REQ::Id of the tone to be set on a number...default is msisdn.vox*/
char *pin; //Used in CHANGE_PIN_REQ
}ui1;
struct ds
{
struct user_info ui;
char *transactionId;
}d1;

on compilation its giving an error like given below::: error: expected ‘)’ before ‘*’ token so please tell me a way out of this error

Recommended Answers

All 6 Replies

which line is it giving the error on?

ishaanarora,
Use struct keyword with function parameter.

void IVR_AL_GET_VM_RETRIEVAL_PROFILE_REQ(struct ds *pline, char xmlToken[][5000])
{ 
   ....
  }

After fixing up some unidentified macros

const int e_LASTCOUNT = 10;
const int e_MESSAGETYPE = 0;
const int e_MSISDN = 1;
const int e_TRANSACTION_ID = 2;

void IVR_AL_GET_VM_RETRIEVAL_PROFILE_REQ(ds *pline, char xmlToken[e_LASTCOUNT][5000])
{
   strcpy(xmlToken[e_MESSAGETYPE],"GET_VM_RETRIEVAL_PROFILE_REQ");
     strcpy(xmlToken[e_MSISDN],pline->user_info.msisdn);
     strcpy(xmlToken[e_TRANSACTION_ID],pline->transactionId);

     return;
}

I got this error which you need to fix
>>error C2039: 'user_info' : is not a member of 'ds'

@adatapost::: I tried that thing its giving redefination sort of error....
@jephthah :::this line

void IVR_AL_GET_VM_RETRIEVAL_PROFILE_REQ(ds *pline, char xmlToken[e_LASTCOUNT][5000])

is giving error
@Ancient dragon:::U have seen my structure definations user_info is nested inside ds structure...and also msisdn,transaction id are 10 digits long so i cant take them as integers

>>strcpy(xmlToken[e_MSISDN],pline->user_info.msisdn);

user_info is the name of a structure, not a member of ds. That line should be this: strcpy(xmlToken[e_MSISDN],pline->ui.msisdn); Now that line has another problem -- msisdn is an integer, and you can't use strcpy() on it. You can use sprintf() to convert the int to a string.

@ancient dragon:::That didn't helped sit what u suggested in above post...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.