[ create a new paste ] login | about

Link: http://codepad.org/QMRcsSEO    [ raw code | output | fork ]

C++, pasted on Jul 12:
#include <cstring>
#include <cassert>

class Test
{
	struct PrivatePointers
	{
		int *a  = nullptr; // NULL
		void *b = nullptr; // NULL
	};

	PrivatePointers p;

public:

	Test(): p() 
	{
		assert(p.a == 0);
		assert(p.b == 0);
	};
};

int main()
{
	Test test;
	return 0;
}


Output:
1
2
Line 8: error: 'nullptr' was not declared in this scope
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: