| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On 01.11.2006, at 06:20, A.J. wrote: No, you probably do mix things up. The function reads a line of text from input (in your case max 255 char). These chars must be put somewhere - and that is where the char* comes into play. You allocate (statically or dynamically) at least 255 bytes of storage and pass a pointer to the beginning of this memory area to the function. The function then puts the read chars there. char strn_text[256]; // give it one more than absolutely needed. I never know if the string end null is included or not cin.getline(strn_text,255); This issue is plain old C. Your problem has noting to do with C++ Have fun ---markus---
Don't miss my latest project at http://blindpromo.com Markus Ruggiero rucotec consulting and technologies email mailto:email@hidden rucotec GmbH web http://www.rucotec.ch Steinentorstrasse 8 4051 Basel Mobile +41 (0)79 508 4701 Switzerland Phone/Fax +41 (0)61 271 4990 |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/xcode-users/email@hidden This email sent to email@hidden
| References: | |
| >Re: Xcode-users Digest, Vol 3, Issue 705 (From: "A.J." <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.