NO

Author Topic: sprintf-s  (Read 2569 times)

Grincheux

  • Guest
sprintf-s
« on: February 21, 2016, 04:56:59 AM »
Why is ther no sprintf_s in Pelle'c C compiler? :(
Code: [Select]
#ifdef __POCC__
sprintf(_szImgRatio,"%16.8f",_dImgRatio) ;
sprintf(_szResult,szSQL_Insert,__iItem,__iImage,__lParam,_dwFileSize,_dwImageSize,_dwImageWidth,_dwImageHeight,_szImgRatio,_szFile_MD5,_szImage_MD5,__lpszCurrentFile) ;
#else
sprintf_s(_szImgRatio,sizeof(_szImgRatio),"%16.8f",_dImgRatio) ;
sprintf_s(_szResult,sizeof(_szResult),szSQL_Insert,__iItem,__iImage,__lParam,_dwFileSize,_dwImageSize,_dwImageWidth,_dwImageHeight,_szImgRatio,_szFile_MD5,_szImage_MD5,__lpszCurrentFile) ;
#endif

JohnF

  • Guest
Re: sprintf-s
« Reply #1 on: February 21, 2016, 08:41:38 AM »
It's in the help file.

=====
Declared in:
<stdio.h>

Description:
The sprintf_s function is equivalent to the sprintf function except for the parameter max and the explicit runtime-constraints.
=====

Edit: I can't get it working though! :(

Yes I can

#define __STDC_WANT_LIB_EXT1__ 1
#include <stdio.h>

John



« Last Edit: February 21, 2016, 09:52:35 AM by JohnF »

Grincheux

  • Guest
Re: sprintf-s
« Reply #2 on: February 21, 2016, 10:03:08 AM »
Thanks, I made change it's ok.