4 ms·
On the other hand, people who write void main clearly have nothing to teach about C++, because that plainly isn't C++.
by msbarnett 15y ago
On the other hand, people who write void main clearly have nothing to teach about C++, because that plainly isn't C++.
- SamReidHughes 15y agoApparently they do, because they're teaching it. But I guess you don't care about that, it's more important that you inform everybody about this distinction whereby you have a definition of C++ that requires more rigorous adherence to one of the standards, because it's very important that people be informed of this. We wouldn't want beginners to write programs that use "void main" and work perfectly fine. For that would be bad. No, this tutorial should be retitled. It should be retitled to "Game Programming with a language that's not exactly C++ but is acceptable to Microsoft's C++ compiler." Because that's a correct title. It would have been a perfectly fine tutorial that would introduce students to C++ programming, but right now it's horrible. I was so glad to learn that people here are aware that C++ says main should return int. Because I was sitting here, wondering if somebody on Hacker News knows that main should return int. And then Ives came along to say, "I do!" That resolved my question. But then as a special treat, somebody else came along to point out that the iostreams library is not part of the STL. Or is it? I sure wouldn't want to forget the distinction between The SL and The STL. For they are different things. I think. Confession time: One time, I learned that I had once learned some C++ from a tutorial that had used "void main." I felt doomed. I had just gotten over the phase where I thought it was okay not to correct somebody when not every part of every clause of every sentence they said was correct. But then I found that I liked using void main. And then before you knew it, I started writing <stdlib.h> instead of <cstdlib>, and then I used C99 header files, and then I used variable length arrays, and I used vector::data, and I liked it. The next thing you know I found myself running two threads at the same time, wouldn't you believe it? Now I know that what I was using was not C++, but that what I used was an abomination.
- deleted 15y ago[deleted]