online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
/* Specify that structure implements the Debug trait i.e. we will be able to print structure contents by using {:?} specifier in our print statements */ #[derive(Debug)] struct Person { name: String , age: u8 } fn main() { // Create struct with field init shorthand //String Literals ( static ) let nameHardCoded:&'static str = "Peter 1"; let age1 = 27; let objPeter1 = Person { name:nameHardCoded.to_string() , age:age1 }; //Debug Basic Print Person 1 println! ( "{0:?}" , objPeter1 ); println!(""); println!(""); //Debug Pretty Print Person 1 println! ( "{0:#?}" , objPeter1 ); println!(""); println!(""); //Print Person 1 along with other data println! ( "variable contents \r\n \r\n {0:#?} \r\n \r\n variable name {1} \r\n \r\n age {2}" , objPeter1 , "objPeter1" , 30 ); }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue