Search
 
SCRIPT & CODE EXAMPLE
 

CPP

reverse sort cpp


int main(){    
  	int arr[5] = {1,3,2,4,5};
	sort(arr, arr+5, greater<int>()); 
  	// arr == {5,4,3,2,1}
  	return 0;
}
Comment

c++ descending sort

sort(arr, arr + n, greater<int>());
Comment

PREVIOUS NEXT
Code Example
Cpp :: hello world c++ visual studio 
Cpp :: compile multiple files C++ linux 
Cpp :: c++ convert binary string to decimal 
Cpp :: c++ min 
Cpp :: qt rotate qimage 
Cpp :: c++ edit another processes memory address 
Cpp :: grpah class data structure 
Cpp :: inreament operator 
Cpp :: strcat without using built in function 
Cpp :: c++ nth substr 
Cpp :: how to output to a file in c++ 
Cpp :: filling dynamic array with a specific value in c++ 
Cpp :: program to convert int to int array c++ 
Cpp :: factore of 20 in c+ 
Cpp :: class Solution { public: vector<vector<int threeSum(vector<int& nums) meaning 
Cpp :: c++ display numbers as binary 
Cpp :: priority queue c++ time complexity 
Cpp :: length of 2d array c++ 
Cpp :: c++ std::copy to cout 
Cpp :: find character in string c++ 
Cpp :: locate specific string letters c++ 
Cpp :: binary string addition 
Cpp :: c++ rule of five 
Cpp :: c++ string remove last character 
Cpp :: reverse c++ string 
Cpp :: c++ print vector without loop 
Cpp :: print float number with only four places after the decimal point in c++ 
Cpp :: sort stl 
Cpp :: loop through a vector in c++ 
Cpp :: C++ Swap 2 Variables Without Using 3rd Variable 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =