Click here to Skip to main content
       

ATL / WTL / STL

 
GeneralRe: CAsyncSocket Connect says in use Pinmemberpasztorpisti16-Sep-12 13:09 
GeneralRe: CAsyncSocket Connect says in use Pinmemberbkelly1316-Sep-12 13:17 
GeneralRe: CAsyncSocket Connect says in use Pinmemberpasztorpisti16-Sep-12 13:34 
GeneralRe: CAsyncSocket Connect says in use [modified] Pinmemberbkelly1316-Sep-12 14:07 
Questionbetter version of strcpy() and printf() Pinmemberbkelly1315-Sep-12 10:02 
AnswerRe: better version of strcpy() and printf() PinmentorPaul Watt15-Sep-12 12:33 
GeneralRe: better version of strcpy() and printf() Pinmemberbkelly1315-Sep-12 15:34 
GeneralRe: better version of strcpy() and printf() PinmentorPaul Watt15-Sep-12 15:45 
I misunderstood part of your question.
 
There are these two functions:
 
strncpy(pDest, pSrc, size)
 
and
 
snprintf(pDest, count, pFormatStr, ...)
 
These will do what you are asking. Read the descriptions though, strncpy will not NULL terminate your string if it can't write all of the data to the buffer. This would open yourself up to another set of possibilities to crash your program.
All of my software is powered by a single Watt.

GeneralRe: better version of strcpy() and printf() Pinmemberbkelly1315-Sep-12 16:23 
GeneralRe: better version of strcpy() and printf() Pinmemberpasztorpisti16-Sep-12 6:54 
GeneralRe: better version of strcpy() and printf() PinmvpRichard MacCutchan16-Sep-12 0:10 
AnswerRe: better version of strcpy() and printf() PinmemberRichard Andrew x6415-Sep-12 17:01 
AnswerRe: better version of strcpy() and printf() PinmvpRichard MacCutchan16-Sep-12 0:09 
AnswerRe: better version of strcpy() and printf() Pinmemberpasztorpisti16-Sep-12 1:37 
AnswerRe: better version of strcpy() and printf() PinmemberStephen Hewitt18-Sep-12 0:29 
Questionget a number into static text control Pinmemberbkelly1313-Sep-12 17:05 
AnswerRe: get a number into static text control PinmvpRichard MacCutchan13-Sep-12 21:52 
GeneralRe: get a number into static text control Pinmemberbkelly1314-Sep-12 15:00 
GeneralRe: get a number into static text control PinmentorPaul Watt14-Sep-12 15:36 
GeneralRe: get a number into static text control PinmvpRichard MacCutchan14-Sep-12 23:02 
GeneralRe: get a number into static text control Pinmemberbkelly1315-Sep-12 5:14 
GeneralRe: get a number into static text control PinmvpRichard MacCutchan15-Sep-12 5:42 
QuestionMirroring system imagelist Pinmemberhuzifa3011-Sep-12 15:27 
QuestionCAsyncSocket, first application [modified] Pinmemberbkelly139-Sep-12 5:26 
AnswerRe: CAsyncSocket, first application PinmentorPaul Watt14-Sep-12 15:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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
Web01 | 2.8.140721.1 | Last Updated 15 Jul 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid