xFactorSchool.com
Python
JavaScript
How to Do Examples
C Examples
Python Examples
HTML Examples
Code Examples
C Code Examples
C++ Code Examples
C# Code Examples
Java Code Examples
Python Code Examples
HTML Code Examples
CSS Code Examples
JavaScript Code Examples
Online Compilers
C Compiler
C++ Compiler
C# Compiler
Java Compiler
Python Compiler
HTML Code Editor
CSS Code Editor
JavaScript Compiler
JavaScript Code Editor
Practice how to declare variable in C++
C++ Online Editor
Execute Code
More C++ Sample Code
#include <iostream> #include <string> using namespace std; // use std namespace to avoid std:: before cout int main() { // Declare variables using data type before variable name string stringVariable = "Example of declaring variable using data type in C++"; cout << stringVariable << endl; // Output: Example of declaring variable using data type in C++ // Declare variables using auto keyword instead of data type auto stringVarVariable = "Example of declaring variable using auto keyword in C++"; cout << stringVarVariable; // Output: Example of declaring variable using auto keyword in C++ return 0; }