strcat-s

    -5熱度

    1回答

    以下幾行有什麼問題? //Thanks to Mark #include <string.h> #include <stdio.h> int main(int argc, char* argv[]) { char datfile[127]; if(argc < 2) return -1; strcpy_s(datfile, strlen(argv[1]), argv[1]); st

    4熱度

    6回答

    我想要的文件名複製到一個字符串和「.CPT」追加到它。但我無法使用安全函數(strcat_s)執行此操作。錯誤:「字符串不是空的終止!」。我確實設置了'\ 0',如何使用安全函數來解決這個問題? size = strlen(locatie); size++; nieuw = (char*)malloc(size+4); strcpy_s(nieuw, size, locatie); nie

    0熱度

    1回答

    下面是我在Win32的項目我的paint方法的代碼中的內存錯誤: case WM_PAINT: _tcscat_s(greeting, sizeof(greeting), LoadedFile); hdc = BeginPaint(hWnd, &ps); TextOut(hdc, 5, 5, greeting, _tcslen(greetin

    0熱度

    3回答

    此代碼中的錯誤是什麼?我有錯誤 error C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead 這是什麼意思?另一個問題 - 結構和函數原型的聲明是合法的? #include <stdio.h> #include <stdlib.h> #include <stri

    0熱度

    2回答

    我已經嘗試了strcat和strcat_s,但它們都崩潰。有誰知道爲什麼發生這種情況?我找不到問題。 Crash: "Unhandled exception at 0x58636D2A (msvcr110d.dll)" _Dst 0x00ea6b30 "C:\\Users\\Ruben\\Documents\\School\\" char * _SizeInBytes 260 u

    -1熱度

    2回答

    我正在使用visual studio做簡單的c練習。 使用strcat_s功能我收到一個衝突異常通過這個代碼: char *str1; str1 = (char *)malloc(20); *str1 = "Ciao "; char *str2 = "Marco"; strcat_s(str1, sizeof(str1), str2); printf("%s", str1); 現在,