answersLogoWhite

0


Best Answer

In short, you don't. strncpy is deemed unsafe as it has potential to cause buffer overruns. To copy strings safely in C++, use std::string instead.

For examples and syntax, see related links, below.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

The prototype of strcpy in C++ is char *strcpy(char *dest, const char *src);

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

strcpy copies a string

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why you are using strcpy in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering
Related questions

C program plus copy of string to another?

strcpy


To copy two strings using strcpy?

Using strcpy and strcat. Or sprintf. Or strlen+memcpy. There are more than solutions.


Write a c program to copy the string without using strcpy?

use strcat, strncpy, stpcpy, sprintf, strlen+memcpy, etc


Built-in functions in turbo c?

i want a coding of a program of a calculator using graphics in c language??


Can you use c in c plus plus without using class and object?

Sure.


To develop a taj mahal using c-language programming in turbo c plus plus?

turbo c


Why study c plus plus programming?

we are using c plus plus programming for developing object oriented programing software.


What is the price of the book data structure using c and c plus plus by tanenbaum?

225 Rs. after discount........


How do you convert bmp image to jpg by using C or C Plus Plus?

With libbmp and libjpeg. STFW for details.


How do you alternate the input numbers using for loop in c plus plus?

Input a variable.


C plus plus program using a stacks converting a postfix-infix?

Yes


What is the Logic to print the letters from A to Z without using printf in Turbo C plus plus?

#include<iostream> int main() { using namespace std; char c='A'; do { cout<<c; }while(c++<'Z'); cout<<endl; }