Reused scope example written
This commit is contained in:
		@@ -1,5 +1,7 @@
 | 
				
			|||||||
2024-06-30  hwpplayer1  <hwpplayer1@debian>
 | 
					2024-06-30  hwpplayer1  <hwpplayer1@debian>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* src/reused_scope.cpp: reused scope example writtenx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	* src/scope_example.cpp: scope example sum of 1 to 10 inclusive is explained
 | 
						* src/scope_example.cpp: scope example sum of 1 to 10 inclusive is explained
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	* src/if_statement.cpp: if statement explained/code written
 | 
						* src/if_statement.cpp: if statement explained/code written
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										18
									
								
								src/reused_scope.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								src/reused_scope.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
				
			|||||||
 | 
					#include <iostream>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int reused = 42;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int main()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    int unique = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    std::cout << reused << " " << unique << std::endl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    int reused = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    std::cout << reused << " " << unique << std::endl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    std::cout << ::reused << " " << unique << std::endl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return 0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Reference in New Issue
	
	Block a user