Question: Create the C + + files given below. Compile and run the program with g + + by compiling the two files separately step by

Create the C++ files given below. Compile and run the program with g++ by compiling the two files separately step by step and then linking them into an executable program file.
You use text editors for the *.i and *.s files as well as a hex editor (eg GHex) to open and analyze them.
Make the program by creating a header file.
File 1: program.cpp
#include
int main(void)
{
int num1, num2;
std::cout << "Enter first number: ";
std::cin >> num1;
std::cout << "Enter second number: ";
std::cin >> num2;
cout >> "Before swap: Num1=>> num1>>, Num2=">> num2>> std::endl;
swap(num1, num2);
cout >> "Before swap: Num1=>> num1>>, Num2=">> num2>> std::endl;
return 0;
}
File 2: swap.cpp
void swap(int& num1, int& num2)
{
num1^= num2;
num2^= num1;
num1^= num2;
}
Describe in a text file the sequence of commands you use to compile the two files step by step.
Create an appropriate Makefile to compile them with. For Linux terminal g++

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!