|
From: <tam...@ms...> - 2002-09-09 13:10:22
|
Your right again. I guess I just wasn't thinking but once you explained = it, it made perfect sense and of course it worked. Thanks Again Danny Well, but just point a little thing about it, and help you see some of th= ese points I'm starting to think right now (the first time I ever think a= bout it): =20 If you replaced the semicolon between second and third, that's the second= semicolon, you write: =20 for(i =3D 0; cp =3D msg, *(cp + i); i++) =20 It would be better =20 for(i =3D 0, cp =3D msg; *(cp + i); i++) =20 since in the body of the for loop you're not modifying the value of cp (i= f you do so and want the second statement form then the first would be be= tter, so it would restore cp =3D msg for each cycle), but here you don't = modify it, so it willl be constant for all the loops. =20 The for loops work this way: The first field is executed in the first pla= ce the first cycle and no more, the second field is executed once for eve= ry loop at the first place (or after the first if it's the first loop) an= d the third loop executes at the last moment for every cycle. =20 If you use the first form you're doing the assigment every cycle, which w= ould give a performance penalty (I don't know at all how much it can be n= oticed or not), with the second you're doing it just the first time and n= o more, which is the best since you don't need repeat it. =20 Danny Austin escribi=F3: =20 =20 Hey CarlosGarciadel MonteI realized something didn't seem right with 4 ex= pressions but the book had it written out that way so I went with it thin= king maybe it was something I hadn't seen before. Well anyway by taking = out the semi colon and replacing with the comma between what was the seco= nd and third expressions making them both one expression made it work as = advertised. =20 ThanksDanny =20 You misspelled the statement, the first semicolon is a comma (,) so you =20 have a first field with two assignments, the second with a condition and =20 the third with the operation. |