Search
 
SCRIPT & CODE EXAMPLE
 

CPP

return multiple objects from a function C++ using references

#include <iostream>
using namespace std;
void div(int a, int b, int &quotient, int &remainder) {
   quotient = a / b;
   remainder = a % b;
}
main() {
   int a = 76, b = 10;
   int q, r;
   div(a, b, q, r);
   cout << "Quotient is: "<< q <<"
Remainder is: "<< r <<"
";
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: c++ find unused class methods 
Cpp :: crtdbg c++ 
Cpp :: Maximum Cake Tastiness codeforces solution 
Cpp :: run program until ctrl-d c++ 
Cpp :: Accepting multiple inputs on the SAME LINE C++ 
Cpp :: 1/2(-3-3)(-3+4) 
Cpp :: do c++ ints neeed to be initlaized 
Cpp :: Arduino C++ servomotor random moving 
Cpp :: Calcular el número mayor y menor C++ 
Cpp :: c++ program to convert kelvin to celsius 
Cpp :: algorithm map values 
Cpp :: how to know how many numbers i deleted with erase command on multiset c++ 
Cpp :: c++ insert vector into vector 
Cpp :: no argument but return value in c++ 
Cpp :: std::random_device 
Cpp :: C++ Dynamic allocation failing 
Cpp :: Jython Java Python 
Cpp :: for in c++ example 
Cpp :: thread group c++ 
Cpp :: 2160. Minimum Sum of Four Digit Number After Splitting Digits leetcode solution in c++ 
Cpp :: skip headers while reading text 
Cpp :: const char * to std::wstring 
Cpp :: c++ sort a 2d vector by column 
Cpp :: template in cpp 
Cpp :: c++ install 
Cpp :: c++ set element at index 
Cpp :: how to initialize priority queue c++ 
Cpp :: run with cpp version 
Cpp :: c++ generate random number upper and lower bound 
C :: terminal count files in directory 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =