strcpy tag

2 questions


1 answers
44 views
0
Question when copying two sentences to a string pointer using the C++ strcpy_s function

When combining two strings in the char*pszResult inside the function Add(charpszLeft, char pszRight),int nLenLeft = strlen(pszLeft);int nLenRight = strlen(pszRight);char *pszResult = new char[nLenLeft...

2 years ago

1 answers
40 views
0
Heap corruption I don't know where and why it's coming from.

Write Code #include <stdio.h>#include <string.h>#include <stdlib.h>int main() { char* szBuffer = (char*)calloc(200,1); scanf_s(%s, szBuffer,_msize(szBuffer)); int length = strlen(szB...

2 years ago

© 2024 OneMinuteCode. All rights reserved.