943,922 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 5533
  • C++ RSS
You are currently viewing page 3 of this multi-page discussion thread; Jump to the first page
Jun 1st, 2006
0

Re: cout is too slow

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.
Reputation Points: 23
Solved Threads: 2
Light Poster
LieAfterLie is offline Offline
38 posts
since May 2006
Jun 2nd, 2006
0

Re: cout is too slow

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.
Reputation Points: 23
Solved Threads: 2
Light Poster
LieAfterLie is offline Offline
38 posts
since May 2006
Jun 4th, 2006
0

Re: cout is too slow

Quote 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.

Quote originally posted by LieAfterLie ...
Unless it has something to do with static?
Nope.

Quote 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.

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

Quote 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.
Moderator
Reputation Points: 3278
Solved Threads: 894
Posting Sage
WaltP is offline Offline
7,738 posts
since May 2006
Jun 4th, 2006
0

Re: cout is too slow

Quote 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.
Reputation Points: 13
Solved Threads: 1
Junior Poster in Training
AhmedHan is offline Offline
71 posts
since Apr 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: mid-chapter exercise inquiry - compile 2 files @ once?
Next Thread in C++ Forum Timeline: constructor with an array as an argument





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC