By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,911 Members | 1,177 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,911 IT Pros & Developers. It's quick & easy.

how to use append function

P: 34
Expand|Select|Wrap|Line Numbers
  1.         EventLogEntryStruct EventLogEntry[100];
  2.         for(int i=1;;i++)
  3.         {
  4.             EventLogEntry[i].logName = "log-";
  5.             EventLogEntry[i].eventString = "event-";
  6.  
  7.  
  8.             EventLogEntry[i].bufPos = i;
  9.             EventLogEntry[i].logIdx = i+1;
  10.             logName.append(i);//= "log-";
  11.             EventLogEntry[i].dateTime = i+4;
  12.             EventLogEntry[i].systemTick = i;
  13.             EventLogEntry[i].resetCount = 1;
  14.             EventLogEntry[i].inAir = 1;
  15.             EventLogEntry[i].appSpec1 = i+2;
  16.             EventLogEntry[i].appSpec2 = i+3;
  17.             EventLogEntry[i].appSpec3 = i+1;
  18.             EventLogEntry[i].timeStampLSW = 12;
  19.             EventLogEntry[i].timeStampMSW = 24;
  20.             EventLogEntry[i].timeStamp = 22;
  21.             EventLogEntry[i].timeDelta = 12;
  22.             EventLogEntry[i].windowID = i+2;
  23.             eventString.append(i);// = "event-1";


here EventLogEntryStruct is a structure defined in my header file and i have created an instance of it as EventLogEntry. now i have to run an infinite loop as its a code in the server side which will be continuously sending data to the client ... now i want to change the logName and eventString everytime in the loop so what i did is at line no 4& 5 i ve declared it and used the append function at line no. 10 & 23 but its throwing error of:

[HTML]D:\trial\serverTrial.cpp(175) : error C2065: 'logName' : undeclared identifier
D:\trial\serverTrial.cpp(175) : error C2228: left of '.append' must have class/struct/union type
D:\trial\serverTrial.cpp(188) : error C2065: 'eventString' : undeclared identifier
D:\trial\serverTrial.cpp(188) : error C2228: left of '.append' must have class/struct/union type[/HTML]
so can any one plz help me ut in sorting this error..
Apr 15 '08 #1
Share this Question
Share on Google+
2 Replies


Banfa
Expert Mod 5K+
P: 8,949
Expand|Select|Wrap|Line Numbers
  1.             logName.append(i);//= "log-";
  2.  
Shouldn't this be

Expand|Select|Wrap|Line Numbers
  1. EventLogEntry[i].logName.append(i);//= "log-";
Apr 15 '08 #2

P: 34
Shouldn't this be

Expand|Select|Wrap|Line Numbers
  1. EventLogEntry[i].logName.append(i);//= "log-";

no it should not be... but i got it how to dooo

thnx ..
Apr 15 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.