Sizeof standard function accepts Typename.
For example
template < typename TYPE >void test(void){
cout << sizeof(TYPE) << endl;
}
It's very usefull.
This blog's themes are Computer Graphic(Especially 3DCG) , Game Development, Programming and so on. Sometimes, other themes written.
template < typename TYPE >void test(void){
cout << sizeof(TYPE) << endl;
}
#include < iostream >
#include < string >
#include < algorithm >
#include < cctype >
using namespace std;
int main(void)
{
string tmp("ABC");
cout << tmp << endl;
transform(tmp.begin(),
tmp.end(),
tmp.begin(),
tolower);
cout << tmp << endl;
return 0;
}
#include <iostream>
#include <stack>
using namespace std;
int main(void)
{
stack<int> datas;// It's that stack contents are dequeue.
datas.push(0x01);
datas.push(0x10);
while( !datas.empty() ){
cout << datas.top() << endl;
datas.pop();
}
return 0;
}
