Re: STRCPY() question Programming Software Development by Ancient Dragon strcpy() does not work with single characters -- it works with entire null-terminated character arrays. If you want to copy just a single character than simply use the = assignment operator. [icode]post[j] = in[x];[/icode] Re: strcpy() Programming Software Development by Nutster …lt;string.h>` for the C prototype of `strcpy`. The error message is indicating that the compiler is …. In MS-Visual Studio, I get **warning C4013: 'strcpy' undefined; assuming extern returning int** when I leave out …parameter prototype, like `extern int strcpy(char *x)` as opposed to `extern int strcpy()`, which knows nothing about its … Re: strcpy() Programming Software Development by deceptikon …string> using namespace std; int main() { char string[6]; strcpy(string, "HELLO\0"); } Which compiles just fine in…> using namespace std; char string[6]; int main() { strcpy(string, "HELLO\0"); } Which pukes with an ambiguity… Re: strcpy() Programming Software Development by deceptikon … one-parameter prototype, like extern int `strcpy(char *x)` as opposed to `extern int strcpy()`, which knows nothing about its indefinite number… Re: strcpy() Programming Software Development by naveen1993 … reference to ur query, int main() { char str[6]; clrscr(); strcpy(str,"Hello\0"); printf("%s",str… string without \0) to another string with the help of strcpy() function it will print as it is. if ur using… strcpy() Programming Software Development by daniel.benniah I tried to enter the following code and the compiler says "[Error] expected ')' before string constant" char string[6]; strcpy(string,"HELLO\0"); can somebody please help me Re: strcpy() Programming Software Development by deceptikon … characters. Avoid using the null character in the string literal. `strcpy` stops copying at the first null character, so the problem… Re: strcpy() Programming Software Development by sepp2k …;` header includes `<cstring>` (or at least somehow declares `strcpy`). But yes, that's pretty much what I tried in… Re: strcpy() Programming Software Development by Nutster … what happens. *Time passes* Ah, nuts! I get **error C3861: 'strcpy': identifier not found** under C++ without `#include <string.h… Strcpy in c++ Programming Software Development by every1play …() { //all the winning combination strcpy(winKey[1].key, "123"); strcpy(winKey[2].key, "456"); strcpy(winKey[3].key, "…;789"); strcpy(winKey[4].key, "… strcpy() and strncpy() Programming Software Development by b.bob …place: [CODE] char fPpn[32] = {0}; strcpy(fPpn, " "); [/CODE] ------------------------------------------------------------------- in another… location: [CODE] char fStr; struct* ioEx; strcpy(fStr, W2A(ioEx->authcode)); [/CODE] --------------------------------------------------------------------- more… Re: strcpy() and strncpy() Programming Software Development by Dave Sinkula … [COLOR="Red"]char* fOutMsg;[/COLOR] strcpy(fOutMsg, "03DS2"); [/CODE] --------------------------------------------------------------… another place: [CODE] char fPpn[32] = {0}; strcpy(fPpn, " "); [/CODE] ------------------------------------------------------------------- in another location… Re: strcpy() and strncpy() Programming Software Development by b.bob … all COM/DCOM/atl .... and I need to change the strcpy to strncpy because we are facing a compliance issue, so… strcpy is not safe and strncpy is required. Now the thing … buffer? Will it be easy to move my code from strcpy to strncpy without having to do lots of modifications? I… Re: Strcpy in c++ Programming Software Development by every1play when i runs it shows error like : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. Re: strcpy() and strncpy() Programming Software Development by dusktreader … trouble. There are no protections with either strcpy or strncpy, and the program using strcpy or strncpy will happily march off the… *strcpy and linked list Programming Software Development by Line … into a char. Can I use *strcpy for this? The way I use *strcpy now isn't working; I'm not…the entire text copied. Maybe the error isn't the strcpy but some other part of my code? Here's the… [code]char *teksten = NULL; teksten=malloc(sizeof(teksten)+1); do { *strcpy(teksten, pdp->dir); printf("%s\n", pdp… Re: strcpy() and strncpy() Programming Software Development by Lerner to look at an online version of the difference between strcpy() and strncpy() go to cppreference.com and look at Standard … Re: strcpy() and strncpy() Programming Software Development by dusktreader … use than some old (and sometimes dangerous) C functions like strcpy, strncpy, atoi, printf, sprintf, etc. strcpy question Programming Software Development by vanalex … to ask something that crossed my mind today about strcpy..I wrote the following piece of code and although …"what's your name?: "; cin.getline(name, 20); strcpy(dname, name); cout << "your name is "…return 0; } [/CODE] I thought that the left parameter in strcpy had to be a pointer to an array that its… strcpy error Programming Software Development by rameshbadi … C using Def c++. I struck at strcpy command. It giving error for a small exercise …;stdio.h> main() { char string[20]; strcpy("Hello", string); printf("%s", …fflush(stdin); getchar(); }[/CODE] it giving error: `strcpy' undeclared (first use this function) Please help me that… Re: strcpy error Programming Software Development by Arbus As waltp said reread the syntax of strcpy(). It should be like this. [CODE]strcpy(string,"HELLO");[/CODE] [COLOR="Green"]strcpy( [/COLOR] /*character array which will hold the text after copying */ , /*string that is to be copied into another array*/[COLOR="Green"] )[/COLOR] ; strcpy not worked create my string Programming Software Development by Nikolas9896 …quot;size text: %d\n", temp); StrCpy( copy_text, text ); printf("TEXT: %s…} return ( copy_str - str ); } else { return ZERO; } } char* StrCpy( char* destination, const char* source ) { int size_source = StrLen( source ); int… Strcpy using pointers Programming Software Development by tentrabyte …guys i need your help. so this is my strcpy program. i am ask to create a program that… will defined function that will do the same strcpy function using pointers only. did i do it right… = " Programming is great"; char string2 [23] = {'\0'}; strcpy (string2, string1); cout<<"string1:"<<… Re: Strcpy using pointers Programming Software Development by Moschops > i am ask to create a program that will defined function that will do the same strcpy You haven't defined any functions. You're supposed to be defining a function that does the same as strcpy. Where is your function to do the same as strcpy? Re: strcpy question Programming Software Development by vanalex … to use a pointer to char with functions such as strcpy, i have to initialize the pointer with a specific allocated… will be allocated from my pointer in order to use strcpy (or a relative function..)?? Thank you again for your instant… Re: strcpy not worked create my string Programming Software Development by deceptikon … error is obvious, but // there's no guarantee of that. StrCpy( copy_text, text ); Now let's fix it: char *text = "…;GOOOD TEXT ALL TIME VERY POOR "; char copy_text[50]; StrCpy( copy_text, text ); In the above correction, `copy_text` is an array… Strcpy Problem using a Private array Programming Software Development by gretty … why? :) Error message: [QUOTE] no matching function for call to `strcpy(std::string[299], std::string[299])' [/QUOTE] [CODE=cplusplus] #include…(infile,pic_array[counter],'\n'); counter++; } } infile.close(); counter = counter-1; strcpy(pic_array,pic_links); // error occurs here } [/CODE] Re: Strcpy Problem using a Private array Programming Software Development by gretty [QUOTE=MosaicFuneral;939422] Oh yeah, std::string is different from a C-string(char pointers/arrays) don't mix them up.[/QUOTE] Thanks, so if I make pic_links a c string then strcpy will work? :) Is strcpy the correct function to copy the contents of one array into another? Or should I be using a different function? :) Re: Strcpy Problem using a Private array Programming Software Development by chiwawa10 When working with std::string only, I recommend to use the equal sign to copy one string to another. Usually I would use strcpy only when I'm caught in a situation dealing with char array and std::string. Is this the right way of using strcpy? Can anyone give some good advice? Regards, Nick Re: Strcpy Problem using a Private array Programming Software Development by Salem You shouldn't be calling strcpy() AT ALL in a C++ program using std::string to … // modify the string. char *temp = new char[mystring.length()+1]; strcpy( temp, mystring.c_str() ); hist2( temp ); // mystring = temp; // if you're…