Click here to Skip to main content
15,909,498 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Why isn't the copy constructor called Pin
Richard MacCutchan22-Sep-20 23:38
mveRichard MacCutchan22-Sep-20 23:38 
GeneralRe: Why isn't the copy constructor called Pin
Mircea Neacsu23-Sep-20 1:56
Mircea Neacsu23-Sep-20 1:56 
AnswerRe: Why isn't the copy constructor called - Solved Pin
Mircea Neacsu23-Sep-20 2:56
Mircea Neacsu23-Sep-20 2:56 
GeneralRe: Why isn't the copy constructor called - Solved Pin
Richard MacCutchan23-Sep-20 3:01
mveRichard MacCutchan23-Sep-20 3:01 
GeneralRe: Why isn't the copy constructor called - Solved Pin
Greg Utas24-Sep-20 1:00
professionalGreg Utas24-Sep-20 1:00 
GeneralRe: Why isn't the copy constructor called - Solved Pin
Mircea Neacsu24-Sep-20 2:51
Mircea Neacsu24-Sep-20 2:51 
GeneralRe: Why isn't the copy constructor called - Solved Pin
Greg Utas24-Sep-20 3:20
professionalGreg Utas24-Sep-20 3:20 
Questioncompilers for pure assembly code Pin
Calin Negru19-Sep-20 0:46
Calin Negru19-Sep-20 0:46 
AnswerRe: compilers for pure assembly code Pin
Richard MacCutchan19-Sep-20 2:24
mveRichard MacCutchan19-Sep-20 2:24 
AnswerRe: compilers for pure assembly code Pin
Joe Woodbury22-Sep-20 11:38
professionalJoe Woodbury22-Sep-20 11:38 
AnswerRe: compilers for pure assembly code Pin
Calin Negru24-Sep-20 1:00
Calin Negru24-Sep-20 1:00 
QuestionWhy do I get "undefined reference to..." when trying to call a C-function inside a .cpp-file? Pin
arnold_w10-Sep-20 4:54
arnold_w10-Sep-20 4:54 
AnswerRe: Why do I get "undefined reference to..." when trying to call a C-function inside a .cpp-file? PinPopular
Richard MacCutchan10-Sep-20 5:30
mveRichard MacCutchan10-Sep-20 5:30 
QuestionIcons for Executable Files - SOLVED Pin
Richard Andrew x649-Sep-20 14:55
professionalRichard Andrew x649-Sep-20 14:55 
QuestionWhat's the closest thing to an anonymous struct/array I can achieve that compiles with GCC? Pin
arnold_w9-Sep-20 8:16
arnold_w9-Sep-20 8:16 
AnswerRe: What's the closest thing to an anonymous struct/array I can achieve that compiles with GCC? Pin
Mircea Neacsu9-Sep-20 11:20
Mircea Neacsu9-Sep-20 11:20 
GeneralRe: What's the closest thing to an anonymous struct/array I can achieve that compiles with GCC? Pin
arnold_w9-Sep-20 11:33
arnold_w9-Sep-20 11:33 
AnswerRe: What's the closest thing to an anonymous struct/array I can achieve that compiles with GCC? Pin
Mircea Neacsu9-Sep-20 12:11
Mircea Neacsu9-Sep-20 12:11 
GeneralRe: What's the closest thing to an anonymous struct/array I can achieve that compiles with GCC? Pin
arnold_w9-Sep-20 12:28
arnold_w9-Sep-20 12:28 
GeneralRe: What's the closest thing to an anonymous struct/array I can achieve that compiles with GCC? Pin
Randor 9-Sep-20 12:44
professional Randor 9-Sep-20 12:44 
AnswerRe: What's the closest thing to an anonymous struct/array I can achieve that compiles with GCC? Pin
Joe Woodbury9-Sep-20 12:38
professionalJoe Woodbury9-Sep-20 12:38 
GeneralRe: What's the closest thing to an anonymous struct/array I can achieve that compiles with GCC? Pin
arnold_w9-Sep-20 14:35
arnold_w9-Sep-20 14:35 
GeneralRe: What's the closest thing to an anonymous struct/array I can achieve that compiles with GCC? Pin
Joe Woodbury9-Sep-20 15:14
professionalJoe Woodbury9-Sep-20 15:14 
GeneralRe: What's the closest thing to an anonymous struct/array I can achieve that compiles with GCC? Pin
Stefan_Lang15-Sep-20 3:34
Stefan_Lang15-Sep-20 3:34 
AnswerRe: What's the closest thing to an anonymous struct/array I can achieve that compiles with GCC? Pin
arnold_w11-Sep-20 12:46
arnold_w11-Sep-20 12:46 
Today I saw the following syntax:
C++
uint16_t getUint16Value(int someParameter) {
    // Unimportant implementation
}

void myFunction() {
    uint16_t destArray[2];
    memcpy(destArray, (uint16_t[2]){getUint16Value(0), getUint16Value(1)}, sizeof(uint16_t[2]));
}
Now, what made me really surprized about this code is that it was inside a .c-file, not a .cpp-file! I looked in the GCC documentation and tried to find examples of clever syntax like this, but I couldn't find any. Does anybody know where I can examples of anonymuous "things" (arrays, structs, function-pointers, etc) that GCC allows in C-code?

modified 11-Sep-20 18:53pm.

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.