cout is too slow

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2006
Posts: 38
Reputation: LieAfterLie is an unknown quantity at this point 
Solved Threads: 2
LieAfterLie's Avatar
LieAfterLie LieAfterLie is offline Offline
Light Poster

Re: cout is too slow

 
0
  #21
Jun 1st, 2006
Thanks. I didnt think to use a matrix like that, so that i dont have to reference every solution individually, i can reference by number (which is sortof what i was looking for to begin with). I wouldn't need getSolution as a function, would I? Since it would only be called once in the program (or atleast only typed once)? Unless it has something to do with static? What does static do? Is it possible to return an array in a function, or only its pointer? And I still would like to know (even though i have no immediate need now) if its possible to store an array with {1,3,6,2....} while not initialising it. Tell me if i'm wrong, but i think i've noticed that you can use either an array or a pointer as an argument (they'd be used differently in the function, of course), and then you can pass either an array or a pointer and it will convert it according to the argument type.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 38
Reputation: LieAfterLie is an unknown quantity at this point 
Solved Threads: 2
LieAfterLie's Avatar
LieAfterLie LieAfterLie is offline Offline
Light Poster

Re: cout is too slow

 
0
  #22
Jun 2nd, 2006
I would like an answer...
I know they seem unrelated, but all these questions have come up from my 15 puzzle program (first program) and are probably simple to most people.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3,121
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 282
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei

Re: cout is too slow

 
0
  #23
Jun 4th, 2006
Originally Posted by LieAfterLie
Thanks. I didnt think to use a matrix like that, so that i dont have to reference every solution individually, i can reference by number (which is sortof what i was looking for to begin with). I wouldn't need getSolution as a function, would I? Since it would only be called once in the program (or atleast only typed once)?
Use the function. It's modular and better programming practice.

Originally Posted by LieAfterLie
Unless it has something to do with static?
Nope.

Originally Posted by LieAfterLie
What does static do?
When used with a variable in a function, each time the function is entered the variable retains the value from the last time the function was used.

Originally Posted by LieAfterLie
Is it possible to return an array in a function, or only its pointer?
Pointer...

Originally Posted by LieAfterLie
And I still would like to know (even though i have no immediate need now) if its possible to store an array with {1,3,6,2....} while not initialising it.
Not a clue what you are asking. In order to get the values in the array it must be initialized somehow.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 71
Reputation: AhmedHan is an unknown quantity at this point 
Solved Threads: 1
AhmedHan's Avatar
AhmedHan AhmedHan is offline Offline
Junior Poster in Training

Re: cout is too slow

 
0
  #24
Jun 4th, 2006
Originally Posted by LieAfterLie
So how can i write a GUI in C++ without the console window?
To use GUI you should first learn Win32 API and/or MFC.
I suggest you learn C++ throughout in the first place.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC