Why http is allowed in c++ compiler | Sololearn: Learn to code for FREE!
+ 1

Why http is allowed in c++ compiler

Below code works without any error : #include <iostream> using namespace std; int main() { http://stackoverflow.com return 0; } I was expecting compiler error. any idea on this ?

15th Jan 2019, 10:18 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
3 Answers
+ 4
As said here- https://www.geeksforgeeks.org/writing-url-c-program/ http: becomes a goto because of ':' and //is just comment
15th Jan 2019, 11:11 AM
Akib - avatar
+ 2
Akib Reza http becomes a "label" (goto is a statement that jumps to labels). That reference fumbles the explanation a bit.
15th Jan 2019, 6:35 PM
Kirk Schafer
Kirk Schafer - avatar
Kirk Schafer I don't know any other explanation. 👀
16th Jan 2019, 4:08 AM
Akib - avatar