Click here to Skip to main content
15,877,446 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: design question : variadic functions use ? . Pin
Mircea Neacsu19-Dec-23 2:42
Mircea Neacsu19-Dec-23 2:42 
GeneralRe: design question : variadic functions use ? . Pin
Maximilien19-Dec-23 2:54
Maximilien19-Dec-23 2:54 
AnswerRe: design question : variadic functions use ? . Pin
jschell19-Dec-23 5:08
jschell19-Dec-23 5:08 
GeneralRe: design question : variadic functions use ? . Pin
Maximilien19-Dec-23 7:36
Maximilien19-Dec-23 7:36 
GeneralRe: design question : variadic functions use ? . Pin
jschell20-Dec-23 5:31
jschell20-Dec-23 5:31 
GeneralRe: design question : variadic functions use ? . Pin
Maximilien20-Dec-23 6:55
Maximilien20-Dec-23 6:55 
GeneralRe: design question : variadic functions use ? . Pin
jschell21-Dec-23 3:31
jschell21-Dec-23 3:31 
Questionstrcpy_s weirdness Pin
mike741119-Dec-23 1:31
mike741119-Dec-23 1:31 
I was playing around in Microsoft Visual C++, and I noticed something weird about this code:

C++
void setname(char name[80])
{
    strcpy_s(name, "joebob");

    char name2[80];
    strcpy_s(name2, "joebob");
}


It looks like the compiler complains about the first strcpy_s but not the second one. If I comment out the first one, the program compiles fine.

Can anyone explain this?

BTW, I know strcpy_s should probably take 3 arguments, but I'm trying to understand this weirdness.

Thanks.
AnswerRe: strcpy_s weirdness Pin
Mircea Neacsu19-Dec-23 1:43
Mircea Neacsu19-Dec-23 1:43 
AnswerRe: strcpy_s weirdness Pin
Richard MacCutchan19-Dec-23 2:04
mveRichard MacCutchan19-Dec-23 2:04 
AnswerRe: strcpy_s weirdness Pin
CPallini19-Dec-23 2:09
mveCPallini19-Dec-23 2:09 
QuestionShould this work in C++? Pin
mike741118-Dec-23 7:07
mike741118-Dec-23 7:07 
AnswerRe: Should this work in C++? Pin
Mircea Neacsu18-Dec-23 7:17
Mircea Neacsu18-Dec-23 7:17 
AnswerRe: Should this work in C++? Pin
Maximilien19-Dec-23 5:11
Maximilien19-Dec-23 5:11 
QuestionC++ memory freeing Pin
mike741116-Dec-23 3:04
mike741116-Dec-23 3:04 
AnswerRe: C++ memory freeing Pin
Richard MacCutchan16-Dec-23 3:21
mveRichard MacCutchan16-Dec-23 3:21 
AnswerRe: C++ memory freeing Pin
Mircea Neacsu16-Dec-23 3:21
Mircea Neacsu16-Dec-23 3:21 
GeneralRe: C++ memory freeing Pin
Daniel Pfeffer21-Dec-23 9:41
professionalDaniel Pfeffer21-Dec-23 9:41 
GeneralRe: C++ memory freeing Pin
Mircea Neacsu21-Dec-23 15:26
Mircea Neacsu21-Dec-23 15:26 
AnswerRe: C++ memory freeing Pin
jschell18-Dec-23 5:30
jschell18-Dec-23 5:30 
GeneralRe: C++ memory freeing Pin
k505418-Dec-23 6:14
mvek505418-Dec-23 6:14 
QuestionFinding the Parent Process Pin
Richard Andrew x6415-Dec-23 8:21
professionalRichard Andrew x6415-Dec-23 8:21 
AnswerRe: Finding the Parent Process Pin
Gerry Schmitz15-Dec-23 8:32
mveGerry Schmitz15-Dec-23 8:32 
GeneralRe: Finding the Parent Process Pin
Richard Andrew x6415-Dec-23 8:47
professionalRichard Andrew x6415-Dec-23 8:47 
GeneralRe: Finding the Parent Process Pin
Gerry Schmitz15-Dec-23 12:36
mveGerry Schmitz15-Dec-23 12:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.