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

What will this output?

Name: Anonymous 2016-06-19 12:21

What will this program output?
Good luck, you'll need it!

#include <iostream>
using namespace std;

int main() {
class c {
public:
c() {
void f();
f();
}
};

c my_c();
}

void f() {
cout << "VALID C++" << endl;
}


The answer is absolutely nothing because c my_c(); is a fucking function declaration.

Name: Anonymous 2016-07-10 7:33

>>24
The comma notation means the int is 'distributed' to each item in the comma-delimited list. So the last item in the list is really int *z. Which means the * is interpreted as the pointer declaration operator, as the dereference operator is a unary operator and multiplying a typename by an undeclared identifier doesn't make sense.

>>28
An infinite lookahead algorithm should halt on all inputs. The number of threads (equal to the number of possible interpretations at the current stage of parsing) and the size of the input are both finite, so every thread will eventually halt either by its interpretation ceasing to be possible or by reaching the end of the input. Even if the ambiguity cannot be resolved (two or more threads survive to the end of input), it still halts.

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