Answers for "? in cpp"

C++
11

initialize an array in c++

int nums[100] = {0}; // initiallize all values to 0

int nums[5] = {1,2,3,4,5};

// type name[size] = {values};
Posted by: Guest on July-07-2020
2

? in cpp

e = ((a < d) ? (a++) : (a = d))
  //advance if else condition
Posted by: Guest on February-02-2021
7

array declaration c++

int foo [5];
Posted by: Guest on March-04-2020
1

define in cpp

#include <iostream> 
  
// macro definition 
#define LIMIT 5 

int main() 
{ 
    for (int i = 0; i < LIMIT; i++) { 
        std::cout << i << "\n"; 
    } 
  
    return 0; 
}
Posted by: Guest on August-12-2020
0

# in c++

You can use '#' sign to get exact name of an argument passed to a macro:
#define what_is(x) cerr << #x << " is " << x << endl;
int variable = 376;
what_is(variable);
// prints "variable is 376"
Posted by: Guest on April-09-2021

Browse Popular Code Answers by Language