Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 2nd, 2005, 3:36 PM   #41
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Quote:
char *str;
str = new char; // for avoiding comipler runtime errors
cin >> str;
Woopsie.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Dec 2nd, 2005, 5:21 PM   #42
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
ROFL!
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for."
-- Socrates
nnxion is offline   Reply With Quote
Old Dec 2nd, 2005, 8:45 PM   #43
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 886
Rep Power: 4 lectricpharaoh will become famous soon enough
Quote:
Originally Posted by Planet_EN
Well, There's no header in Turbo C++ 3.1 which can "enable" or "provide" you string function (or class ...or whatever you want to say it...)

Although there are some way you have in Turbo C++ to input a full string.
The simplest you'd find is:
char *str;
str = new char; // for avoiding comipler runtime errors
cin >> str;
What DaWei and nnxion said. You've got a big oops here, and the irony is that you commented the offending line's purpose as avoiding errors, even if you were a little unsure whether it was a compiler error or a runtime error.

Try
str = new char[BUFFERSIZE];
instead.
Quote:
Originally Posted by Planet_EN
But it'll ignore everything after the whitespace(after you hit spacebar while entering a string).
To overcome this problem, try any of the below listed suggestions:
<snip>

I'm not sure how many of those will work, as we've already established he's got a pre-standard compiler. Those methods may differ in parameters, semantic function, or may even be absent entirely.
__________________
A man's knowledge is like an expanding sphere, the surface corresponding to the boundary between the known and the unknown. As the sphere grows, so does its surface; the more a man learns, the more he realizes how much he does not know. Hence, the most ignorant man thinks he knows it all. - L. Sprague de Camp
lectricpharaoh is offline   Reply With Quote
Old Dec 3rd, 2005, 12:58 PM   #44
Planet_EN
Programmer
 
Join Date: Mar 2005
Posts: 40
Rep Power: 0 Planet_EN is an unknown quantity at this point
Quote:
Originally Posted by lectricpharaoh
<snip>

I'm not sure how many of those will work, as we've already established he's got a pre-standard compiler. Those methods may differ in parameters, semantic function, or may even be absent entirely.
I have worked on Turbo C++ in my school days too. As far as i remember, they all work on it.
Planet_EN is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

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

Posting 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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:52 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC