unable to use safe string function in C | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 4

unable to use safe string function in C

C11 introduces new function to eradicate buffer overflow while using string in C, --> strnlen_s, strncmpy_s etc where introduced, according to my research I can use this function using #define __STDC_WANT_LIB_EXT1__ 1, the problem now is that it's not working https://code.sololearn.com/cvNapT5f0CFV/?ref=app

3rd Apr 2019, 6:25 PM
āœ³AsterisKāœ³
āœ³AsterisKāœ³ - avatar
9 Respostas
3rd Apr 2019, 7:25 PM
TheWhĀ”teCat šŸ‡§šŸ‡¬
TheWhĀ”teCat šŸ‡§šŸ‡¬ - avatar
+ 5
~ swim ~ its not working on a compiler
3rd Apr 2019, 8:22 PM
āœ³AsterisKāœ³
āœ³AsterisKāœ³ - avatar
+ 4
~ swim ~ according to the information TheWhiteCatšŸ’” provided for me, it was not full accepted into the gnu11
3rd Apr 2019, 8:26 PM
āœ³AsterisKāœ³
āœ³AsterisKāœ³ - avatar
+ 4
version 4.2.1 on my mobile 4.9.2 on my PC
3rd Apr 2019, 8:28 PM
āœ³AsterisKāœ³
āœ³AsterisKāœ³ - avatar
+ 4
thanks ~ swim ~ šŸ‘šŸ‘šŸ‘
3rd Apr 2019, 8:33 PM
āœ³AsterisKāœ³
āœ³AsterisKāœ³ - avatar
+ 3
You can find useful info in this discussion: https://stackoverflow.com/questions/15610053/correct-printf-format-specifier-for-size-t-zu-or-iu?lq=1. According to the discussion this prefix "z" is not supported by Microsoft. You can use "I". You can see it in the code. https://code.sololearn.com/cvEyE4Wac4m1/?ref=app
3rd Apr 2019, 6:55 PM
TheWhĀ”teCat šŸ‡§šŸ‡¬
TheWhĀ”teCat šŸ‡§šŸ‡¬ - avatar
+ 3
TheWhiteCatšŸ’” thanks I will check the link out now, but the last printf is not outputting anything, which is the part I really need edited: thanks, the thread do not answer my question
3rd Apr 2019, 7:17 PM
āœ³AsterisKāœ³
āœ³AsterisKāœ³ - avatar
+ 2
thanks alot TheWhiteCatšŸ’” , now I need to get my hope out of that, maybe create my own safe functions, šŸ˜‰šŸ˜‰šŸ˜‰šŸ˜‰
3rd Apr 2019, 7:30 PM
āœ³AsterisKāœ³
āœ³AsterisKāœ³ - avatar
+ 1
*AsterisK* , you are welcome šŸ˜‰
3rd Apr 2019, 7:35 PM
TheWhĀ”teCat šŸ‡§šŸ‡¬
TheWhĀ”teCat šŸ‡§šŸ‡¬ - avatar