Click here to Skip to main content
12,505,655 members (50,702 online)

ATL / WTL / STL

 
Questionbetter version of strcpy() and printf() Pin
bkelly1315-Sep-12 10:02
memberbkelly1315-Sep-12 10:02 
There are numerous versions of the basic copy function, too many now. some of the new versions are declared safer because they incorporate a limiting count value. However, all the ones I have tried and inadvertenly tested just crash the application. I find that rather rude.

Are there any versions of ...cpy...() and ...printf...() that limit the count of characters copied to the space found in the destination string. Without an ungracefull app crash?

Thanks for your time
AnswerRe: better version of strcpy() and printf() Pin
Paul Watt15-Sep-12 12:33
mentorPaul Watt15-Sep-12 12:33 
GeneralRe: better version of strcpy() and printf() Pin
bkelly1315-Sep-12 15:34
memberbkelly1315-Sep-12 15:34 
GeneralRe: better version of strcpy() and printf() Pin
Paul Watt15-Sep-12 15:45
mentorPaul Watt15-Sep-12 15:45 
GeneralRe: better version of strcpy() and printf() Pin
bkelly1315-Sep-12 16:23
memberbkelly1315-Sep-12 16:23 
GeneralRe: better version of strcpy() and printf() Pin
pasztorpisti16-Sep-12 6:54
memberpasztorpisti16-Sep-12 6:54 
GeneralRe: better version of strcpy() and printf() Pin
Richard MacCutchan16-Sep-12 0:10
mvpRichard MacCutchan16-Sep-12 0:10 
AnswerRe: better version of strcpy() and printf() Pin
Richard Andrew x6415-Sep-12 17:01
memberRichard Andrew x6415-Sep-12 17:01 
AnswerRe: better version of strcpy() and printf() Pin
Richard MacCutchan16-Sep-12 0:09
mvpRichard MacCutchan16-Sep-12 0:09 
AnswerRe: better version of strcpy() and printf() Pin
pasztorpisti16-Sep-12 1:37
memberpasztorpisti16-Sep-12 1:37 
AnswerRe: better version of strcpy() and printf() Pin
Stephen Hewitt18-Sep-12 0:29
memberStephen Hewitt18-Sep-12 0:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.160927.1 | Last Updated 30 Jul 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid