Code::Blocks Forums

User forums => Help => Topic started by: Ducky on May 29, 2009, 09:36:05 pm

Title: strcpy_s
Post by: Ducky on May 29, 2009, 09:36:05 pm
Hello!

Im trying to compile this simple example with strcpy_s and getting

`strcpy_s' was not declared in this scope error.

If i use the "old" strcpy, it works.

Code
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>

int main( void )
{
   char string[80];
   // using template versions of strcpy_s and strcat_s:
   strcpy_s( string, "Hello world from " );
   strcat_s( string, "strcpy_s " );
   strcat_s( string, "and " );
   // of course we can supply the size explicitly if we want to:
   strcat_s( string, _countof(string), "strcat_s!" );

   printf( "String = %s\n", string );
}

Title: Re: strcpy_s
Post by: Jenna on May 29, 2009, 09:56:10 pm
This forum is dedicated to C::B related questions only.

It's not a general programming forum.

Sorry.

Topic locked !