Search
 
SCRIPT & CODE EXAMPLE
 

CPP

macro c++

#include <isotream>
#define print(x) std::cout << x << std::endl

int main(){
  std::string sentence = "Hello World!";
  print(sentence); // OUTPUT: Hello World!
}
Comment

Macros in c++

#define var(datatype, name, value) datatype name = value;

int main()
{
 var(string, hello, "Hello World!");
 cout << hello;
 
 //Hello World!
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: how to slice vector in c++ 
Cpp :: C++ Conditions and If Statements 
Cpp :: Max element in an array with the index in c++ 
Cpp :: c++ compile to exe command line 
Cpp :: check if element in dict c++ 
Cpp :: C++ Infinite while loop 
Cpp :: how to print in new lines in C++ 
Cpp :: all permutations with repetition C++ 
Cpp :: c++ Least prime factor of numbers till n 
Cpp :: c++ preprocessor operations 
Cpp :: how to concatenate two vectors in c++ 
Cpp :: 31. Next Permutation leetcode solution in c++ 
Cpp :: c++ reverse part of vector 
Cpp :: system("pause") note working c++ 
Cpp :: template c++ 
Cpp :: c++ shell 
Cpp :: c++ data types 
Cpp :: print in c ++ 
Cpp :: c++ fonksion pointer 
Cpp :: text color c++ 
Cpp :: cpp oop 
Cpp :: full implementation of binary search tree in C++ 
Cpp :: square gcode 
Cpp :: how to increase array memory in c++ 
Cpp :: c++ linked list delete node 
Cpp :: Arduino Real TIme Clock 
Cpp :: string c++ 
Cpp :: the difference between i++ and ++i 
Cpp :: 1. Two Sum 
Cpp :: c++ function overloading 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =