Is the default value of an int* NULL?

Viewed 2533

I have written the following source

#include <iostream>
using namespace std;

template <class T>
class AAA
{
public:
    void f() { cout << T() << " "; }
};

int main ( void )
{
    AAA<int*> a;
    AAA<int> b;

    a.f(); /// in this case, T() == NULL??
    b.f(); 

    return 0;
}

and console print is 00000000 0. ( in visual studio 2010 )

if T is int*, T() == NULL? and is it always true?

3 Answers
Related