Write a URL in a C++ program
Writing URLs in a C++ code doesn’t affect the program and the compiler will not throw any error.
// C++ program to demonstrate URL in code #include <iostream> using namespace std; int main() { http: //www.breakthecodenow.blogspot.in/ for ( int i = 0; i < 5; i++) { cout << "This code is error free" << endl ; // Uncommenting below goto statement causes // infinite loop // goto http; } return 0; } |
Output:
This code is error free This code is error free This code is error free This code is error free This code is error free
Explanation:
- Any identifier followed by a : becomes a (goto) labels in C.
- A single line comment begins with a // and so in http://www.breakthecodenow.blogspot.in and so it is a comment. And therefore:
label- http: comment- www.breakthecodenow.blogspot.in/
No comments:
Post a Comment