Zelaron Gaming Forum  
Stats Arcade Portal Forum FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read
Go Back   Zelaron Gaming Forum > The Zelaron Nexus > Science and Art > Tech Help

 
 
Thread Tools Display Modes

 
Reply
Posted 2003-10-14, 05:00 PM in reply to Chruser's post "Unmanageable C++ code"
This is the first one, as far as I can figure out (only 1 year of C++, like 3 years ago).


Code:


#include <iostream.h>
#include <stdlib.h>

struct WierdVarType {int A; int B;};

void main()
{


   WierdVarType test={12,1337}; 
   test.A += 5; 
   cout << test.A << endl;


   for(;;)  /*Yay for infinite loops*/
      { 
         cout << ++test.B << endl;
      }

}


...

So would the output be:

17
1338
1339
1340
1341
1342
1343
1344
(and so on)

I'm not quite sure. I think the ++test.B would increment before it prints out on screen.

Unless I screwed it up and it doesn't compile..

Hmm.. seems I need more C++ classes!
Old
Profile PM WWW Search
BlueCube enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHzBlueCube enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHz
 
 
BlueCube
 



 

Bookmarks

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules [Forum Rules]
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 03:19 AM.
'Synthesis 2' vBulletin 3.x styles and 'x79' derivative
by WetWired the Unbound and Chruser
Copyright ©2002-2008 zelaron.com
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.