Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please explain the codes from 173 to 179. Its pointer lab in C * * * 167 159 * Given pointers to two distinct variables
Please explain the codes from 173 to 179. Its pointer lab in C
* * * 167 159 * Given pointers to two distinct variables write a function to swap the values 160 * of said variables. 161 * 162 * ALLOWED: 163 Pointer operators: *, & 164 Binary integer operators: -, +, * 165 Unary integer operators: ! 166 Shorthand operators based on the above: ex. +=, *=, ++, --, etc. * 168 * DISALLOWED: 169 * Pointer operators: [] (Array Indexing Operator) 170 Binary integer operators: &, &&, lill, , >, ==, !=;^, /, % 171 * Unary integer operators: ~, 172 */ 173 void swapInts(int * ptri, int * ptr2) { 174 // Your code here 175 176 int temp; 177 temp = * ptr1; 178 * ptr1 = * ptr2; 179 * ptr2 = temp; 180 } 181Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started