Top "Strcpy" questions

The C standard library function, "strcpy()," is used to copy non-overlapping, null-terminated strings.

strcpy was not declared in this scope?

#include <iostream> #include <string> using namespace std; int main() { char Buffer[20] = {'\0'}; cout << "…

c++ strcpy
How to fix strcpy so that it detects overlapping strings

In an interview, I was asked to write an implementation of strcpy and then fix it so that it properly …

c overlap strcpy
Program aborts when using strcpy on a char pointer? (Works fine on char array)

I'm perplexed as to why the following doesn't work: char * f = "abcdef"; strcpy(f, "abcdef"); printf("%s",f); char s[] = "…

c strcpy
Copy array of strings into another array in C

I'm making a word search program in C which takes the user input and then chooses one of the global …

c arrays char strcpy
Understanding char *, char[] and strcpy()

My understanding is as follows: char * points to a string constant, modifying the data it points to is undefined. You …

c arrays string pointers strcpy
format ’%s’ expects argument of type ’char *’

For exercising my programming skills in C I'm trying to write the strncpy function by myself. Doing that I kept …

c string printf strcpy strncpy
Strcpy Segmentation Fault C

I am learning some new things and get stuck on a simple strcpy operation. I don't understand why first time …

c strcpy
C++ std::string alternative to strcpy?

I know there is a similarly titled question already on SO but I want to know my options for this …

c++ stdstring strcpy
C++ copy std::string to char array with no null termination

I am writing to a binary file using a struct that just contains a char[32]. I basically need to format …

c++ stdstring strcpy arrays
Access violation when using strcpy?

I've tried reinventing the strcpy C function, but when I try to run it I get this error: Unhandled exception …

c strcpy