468,484 Members | 2,140 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,484 developers. It's quick & easy.

how to use append function

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
2 2359
Banfa
9,055 Expert Mod 8TB
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
pralu
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.

Similar topics

8 posts views Thread by WordVBAProgrammer | last post: by
5 posts views Thread by solar | last post: by
2 posts views Thread by jeremito | last post: by
reply views Thread by theflame83 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.