What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » C - vectors

C - vectors
Author: Message:
Chancer
Senior Member
****

Avatar

Posts: 648
Reputation: 7
34 / Male / Flag
Joined: May 2005
Status: Away
O.P. RE: C - vectors
quote:
Originally posted by TheSteve
Keep in mind that strlen() will only work if your string has a null character at the end.  In the case of scanf, it should be null terminated as long as the user doesn't input more than 19 characters.   (more than that and the program could crash or just act strangely of course.)
Yes, of course.
If I was taugth right, the last thing that '%s' adds to the sequence is '\0'. So this is the 'null character' you mentioned.
06-19-2008 01:57 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
C - vectors - by Chancer on 06-15-2008 at 01:53 AM
RE: C - vectors - by Mnjul on 06-15-2008 at 11:12 AM
RE: C - vectors - by Chancer on 06-15-2008 at 08:34 PM
RE: C - vectors - by TheSteve on 06-16-2008 at 05:28 AM
RE: C - vectors - by Chancer on 06-19-2008 at 01:57 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On