tags:

views:

106

answers:

1

I have recently migrated the code fom 32 bit to 64 bit and have a query. I am geting core in my code after 64 migration.

int main (int ac, char *av[])
{
    char    myTable[51];
    memset(myTable, 0x00, sizeof(myTable));
    myFunc(ac, av, myTable);
}
myFunc(int argc, char *argv[], char* myTable)    
{
    Config config;
    /*** config.getMyTable() is giving proper value however the strcpy is causing core dump **/
    /** config.getMyTable() is returning a string I have verified it by a pritf() ***/
    strcpy(myTable,config.getMyTable());
}

Config::Config()
{
}

const char* Config::getMyTable() const
{
  return "REWARD_MY_TABLE";
}

Please suggest. The same code is working fine on 32 bit. I am using C++ on UNIX.

A: 

Some quick googling indicates that your problem is not unique. Do you get the same results with strncpy?

Dakota Hawkins
What are those googling facts
Sachin Chourasiya
I don't understand the question.
Dakota Hawkins