Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ANSI C++ COde HELP PLS

Status
Not open for further replies.

vijk2001

Programmer
Mar 12, 2003
1
US
I have a piece of C++ code which is to be migrated to ANSI C++.Im doing the standard namespaces..std:: changes etc but there is one portion which is NOT compiling(It compiled fine in Legacy C++..) Pls help.

File #1 Field.cpp
------------------------
------------------------------
( (Header.getFieldMDStatic() ).getFieldSummary() ) . setFieldName("HEADER");

File # 2 FieldSummary.h
-----------------------
------------------------
char *fieldName;
long fieldType;

void setFieldName (char *name)
{
fieldName = name;
}

WARNING /ERROR: String Literal converted to char* in formal argument name in call to FieldSummary::setFieldName (char*)
 
Sounds like it wants you to use a const char* instead of a char*.
 
Is this a warning or an error?
Anyway, it's obviously flagging the fact that you're passing in a literal.. So, don't pass a literal; pass char * variable ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top