Click here to Skip to main content
14,326,008 members

C / C++ / MFC

 
AnswerRe: Error 12029 WinHTTP Pin
Richard MacCutchan13-Sep-19 1:16
protectorRichard MacCutchan13-Sep-19 1:16 
AnswerRe: Error 12029 WinHTTP Pin
Victor Nijegorodov13-Sep-19 2:26
memberVictor Nijegorodov13-Sep-19 2:26 
GeneralRe: Error 12029 WinHTTP Pin
Diprom13-Sep-19 2:30
memberDiprom13-Sep-19 2:30 
GeneralRe: Error 12029 WinHTTP Pin
Victor Nijegorodov13-Sep-19 2:38
memberVictor Nijegorodov13-Sep-19 2:38 
AnswerRe: Error 12029 WinHTTP Pin
Randor 14-Sep-19 3:03
professional Randor 14-Sep-19 3:03 
QuestionVisual Studio 2017 C++ Static analyzer (or in ReSharper C++) Pin
Maximilien12-Sep-19 4:21
memberMaximilien12-Sep-19 4:21 
AnswerRe: Visual Studio 2017 C++ Static analyzer (or in ReSharper C++) Pin
Stefan_Lang12-Sep-19 5:33
memberStefan_Lang12-Sep-19 5:33 
AnswerRe: Visual Studio 2017 C++ Static analyzer (or in ReSharper C++) Pin
CPallini12-Sep-19 21:08
mveCPallini12-Sep-19 21:08 
Now that is pretty interesting.
The following code
#include <iostream>
using namespace std;
class Foo
{
  int a = b;
  int b = 5;

public:
  void show(){ cout << "a " << a << ", b " << b << endl;}

};

class Boo
{
  int a;
  int b;
public:
  Boo(): a(b), b(5){}
  void show(){ cout << "a " << a << ", b " << b << endl;}
};


class Goo
{
  int a;
  int b=5;
public:
  Goo():a(b){}
  void show(){ cout << "a " << a << ", b " << b << endl;}
};


int main()
{
  Foo f;
  f.show();
  Boo b;
  b.show();
  Goo g;
  g.show();
}

compiled with
g++ -Wall

issues NO warning and produces the following output on my Linux box
a 0, b 5
a 0, b 5
a 32766, b 5


The lesson I learnt (while waiting for more clever people to add insight) is "Timeo Danaos and C++ Default Initializers for class members".
GeneralRe: Visual Studio 2017 C++ Static analyzer (or in ReSharper C++) Pin
Stefan_Lang12-Sep-19 22:19
memberStefan_Lang12-Sep-19 22:19 
GeneralRe: Visual Studio 2017 C++ Static analyzer (or in ReSharper C++) Pin
Stefan_Lang12-Sep-19 23:26
memberStefan_Lang12-Sep-19 23:26 
AnswerRe: Visual Studio 2017 C++ Static analyzer (or in ReSharper C++) Pin
Stefan_Lang12-Sep-19 22:46
memberStefan_Lang12-Sep-19 22:46 
QuestionMFC VC++ ListCtrl Pin
Member 1457555612-Sep-19 1:23
memberMember 1457555612-Sep-19 1:23 
AnswerRe: MFC VC++ ListCtrl Pin
CPallini12-Sep-19 1:32
mveCPallini12-Sep-19 1:32 
GeneralRe: MFC VC++ ListCtrl Pin
Member 1457555612-Sep-19 1:41
memberMember 1457555612-Sep-19 1:41 
GeneralRe: MFC VC++ ListCtrl Pin
Richard MacCutchan12-Sep-19 1:45
protectorRichard MacCutchan12-Sep-19 1:45 
AnswerRe: MFC VC++ ListCtrl Pin
Victor Nijegorodov12-Sep-19 1:41
memberVictor Nijegorodov12-Sep-19 1:41 
QuestionRe: MFC VC++ ListCtrl Pin
David Crow12-Sep-19 7:26
memberDavid Crow12-Sep-19 7:26 
Questionfast return of data to the server Pin
Diprom11-Sep-19 22:36
memberDiprom11-Sep-19 22:36 
AnswerRe: fast return of data to the server Pin
Diprom11-Sep-19 23:11
memberDiprom11-Sep-19 23:11 
GeneralRe: fast return of data to the server Pin
Stefan_Lang12-Sep-19 6:02
memberStefan_Lang12-Sep-19 6:02 
QuestionVirtual address of pointer keeps changing Pin
Rakanoth9-Sep-19 22:45
memberRakanoth9-Sep-19 22:45 
AnswerRe: Virtual address of pointer keeps changing Pin
Richard MacCutchan9-Sep-19 23:18
protectorRichard MacCutchan9-Sep-19 23:18 
GeneralRe: Virtual address of pointer keeps changing Pin
Rakanoth10-Sep-19 2:28
memberRakanoth10-Sep-19 2:28 
GeneralRe: Virtual address of pointer keeps changing Pin
OriginalGriff10-Sep-19 2:29
protectorOriginalGriff10-Sep-19 2:29 
GeneralRe: Virtual address of pointer keeps changing Pin
Rakanoth10-Sep-19 2:48
memberRakanoth10-Sep-19 2:48 

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.