-
February 5th, 2014, 11:18 PM
#1
strncpy_s
error: 'strncpy_s' was not declared in this scope . compiling on ubuntu (linux). what is it?
-
February 6th, 2014, 03:57 AM
#2
Re: strncpy_s
AFAIK, it's Microsoft specific. strncpy is standard.
Cheers, D Drmmr
Please put [code][/code] tags around your code to preserve indentation and make it more readable.
As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky
-
February 6th, 2014, 06:24 AM
#3
Re: strncpy_s
If I use strncpy, then found other errors. Works only with strncpy_s
part of code:
std::strncpy_s(username, 40, text + 1, accend - 1);
...
and:
char days[10];
if (text[1] == ' ')
strncpy_s(days, 10, text, 1);
else if (text[2] == ' ')
strncpy_s(days, 10, text, 2);
else if (text[3] == ' ')
strncpy_s(days, 10, text, 3);
else
...
-
February 6th, 2014, 06:31 AM
#4
Re: strncpy_s
Originally Posted by XOM91K
If I use strncpy, then found other errors. Works only with strncpy_s
Replace those calls with strncpy() and provide the correct parameters. See here:
http://www.cplusplus.com/reference/cstring/strncpy/
Second, this is the Visual C++ forum -- issues with another compiler should be directed to the Non-Visual C++ forum.
Last, an operating system is not a compiler -- mentioning "Ubuntu" and Linux" doesn't tell us what compiler and version of the compiler you're using. More than likely it is gcc / g++.
Regards,
Paul McKenzie
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|