Search
 
SCRIPT & CODE EXAMPLE
 

CPP

C++ for loop using for auto

//I think this is a better way for a for loop
//for like going through arrays or something
//hope you like it :)
//be sure to do #include <set>
int main()
{
  set<char> letters = {'A', 'B', 'C'};
  for (auto itr = letters.begin(); itr != letters.end(); ++itr){
    cout << *itr << endl;
  }
}
Comment

for auto c++

for (auto&& [first,second] : mymap) {
    // use first and second
}
Comment

c++ auto loop

for(auto x: myVector){
	cout<< x << " ";
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: operator overload 
Cpp :: auto i cpp 
Cpp :: random c++ 
Cpp :: c++ remove last element from array 
Cpp :: c++ array on heap 
Cpp :: fenwick tree 
Cpp :: conditions in c++ 
Cpp :: C++ Area and Circumference of a Circle 
Cpp :: array list cpp 
Cpp :: how to replace an element in array in c++ 
Cpp :: how to make an enum in c++ 
Cpp :: binary add using strings 
Cpp :: a function to create double quotes for alphabet in c++ 
Cpp :: qt graphics scene map cursor position 
C :: find string in all files powershell 
C :: How to install npm in alpine linux 
C :: pygame draw transparent rectangle 
C :: random number in c 
C :: rl_replace_line 
C :: binary search in c 
C :: postgres random select 
C :: search array element in c 
C :: c integer to string 
C :: c fork wait for child 
C :: How to change an array in a function in c 
C :: c strcat 
C :: extract substring after certain character in flutter 
C :: enable disable audio listener unity 
C :: loading builder in flutter 
C :: fgets c 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =