c++ - error C2448: function-style initializer appears to be a function definition -


i have following piece of code -

void commandprocessor::replaceporttag((void *) portid) {     std::string temp = std::string.empty();     int start = 0;     (int i=0; i<commandprocessor::filecontents.length(); i++)     {         if (commandprocessor::filecontents.substr(i,6) == "<port>")         {             temp += commandprocessor::filecontents.substr(start,i-start);             temp += portid;             start = i+6;         }     }     temp += commandprocessor::filecontents.substr(start+6,commandprocessor::filecontents.length()-start-6);     commandprocessor::filecontents = temp; } 

when try compile i'm getting error -

error c2448: 'commandprocessor::replaceporttag' : function-style initializer appears function definition 

i unable figure out i'm going wrong. modify fix error?

this syntax means c-style casting variable portid void*

void commandprocessor::replaceporttag((void *) portid) 

if argument supposed void* function declaration should be

void commandprocessor::replaceporttag(void* portid) 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -