1. Can a class template or a function template have only non-type parameters?
2. Can a template have only specializations without a "general" definition?
3. Is the scope of i and/or j limited to the for loop itself or they are just like any local variable inside Func()? or int j inside a loop is illegal?
1 2 3 4 5 6 7
void func()
{
for (int i=0;i<6;i++)
{
int j=i-9;
}
}
4. When declaring an array of objects, can I use a non-default constructor? For example:
Yes, I could, but the weekly time in which I can use a computer with a C++ compiler is very very limited and I'm very busy, so asking saves time. It's faster than doing experiments. I can post a question on a computer without a compiler, to which I have access more frequently...
Indeed, but I'm not learning it anymore. I just ask little questions whenever they arise, but aside from that I write C++ code in my notebooks without needing a tutorial.