79783055

Date: 2025-10-05 15:52:56
Score: 0.5
Natty:
Report link

As @wohlstad pointed out, C arrays are non-copyable. I have to use the way of using a temporary bar variable, set the members and provide this to push_back()

    bar tempBar;
    
    tempBar.barInt  = 1;
    strcpy( tempBar.barChar, fooString );
    foo.push_back( tempBar );
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • User mentioned (1): @wohlstad
  • Self-answer (0.5):
  • High reputation (-1):
Posted by: Peter VARGA