Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

An enigma

Name: Anonymous 2009-06-09 18:35

So, /prog/, a C question: I have int somevariable [10][10]; How do I declare a pointer to the first row of this array?

Name: Anonymous 2009-06-11 12:08

>>29
You might be surprised, but C++ actually much more robust and turnkey array support than C.
[code=cpp]
template <typename T, int length>
int array_length(const T (&t)[length])
{
    return length;
}

int main(int argc, char* argv[])
{
    char s[] = "abc";
    cout << array_length(s) << endl;
}
[/code]

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List