Author Topic: strcpy_s  (Read 10558 times)

Ducky

  • Guest
strcpy_s
« 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 );
}


Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: strcpy_s
« Reply #1 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 !