Programming Forums
User Name Password Register
 

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

Reply
 
Thread Tools Display Modes
Old Feb 5th, 2005, 9:08 PM   #1
quantalfred
Newbie
 
Join Date: Jan 2005
Posts: 21
Rep Power: 0 quantalfred is on a distinguished road
Question Store a word using input

I'd like to know how to save an input of words in a char array, but we don't know beforehand the number of characters we need to save.
quantalfred is offline   Reply With Quote
Old Feb 5th, 2005, 9:18 PM   #2
uman
Expert Programmer
 
Join Date: Dec 2004
Posts: 794
Rep Power: 4 uman is on a distinguished road
Can you use C++ instead? Because the C++ string class provides much better string operations than that of C, and can hold trings of an arbitrary length.
uman is offline   Reply With Quote
Old Feb 5th, 2005, 11:26 PM   #3
quantalfred
Newbie
 
Join Date: Jan 2005
Posts: 21
Rep Power: 0 quantalfred is on a distinguished road
Got it, thanks.
quantalfred is offline   Reply With Quote
Old Feb 6th, 2005, 1:49 AM   #4
Dietrich
Professional Programmer
 
Dietrich's Avatar
 
Join Date: Feb 2005
Posts: 434
Rep Power: 4 Dietrich is on a distinguished road
Wink

If you want to use C++ then visit our sister-site DaniWeb. There is a little code snippet called "Playing around with std::string" that gives you some insight into C++ string. Look at:
http://www.daniweb.com/code/snippet117.html
Dietrich 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 6:53 PM.

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