Hi,
I am a newbie to C++ (and programming in general)
I have the following:
char* fOutMsg;
strcpy(fOutMsg, "03DS2");
--------------------------------------------------------------
in another place:
char fPpn[32] = {0};
strcpy(fPpn, " ");
-------------------------------------------------------------------
in another location:
char fStr;
struct* ioEx;
strcpy(fStr, W2A(ioEx->authcode));
---------------------------------------------------------------------
more:
char* iProdType;
strcpy((char*) fDef.prodtype, iProdType);
------------------------------------------------------------------------
and:
strcpy(fI8_GPID, "%");
So as you can see, I have different parameters for strcpy in different places in the code, I was wondering how to substitute strcpy with strncpy.
How does it work? could you please provide me real examples based on my above data? As I said, I am new to C++ and I don't know how to terminate the buffer with null or not so please be patient with me
Thanks