Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120932226
exercise05-3.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jul 7, 22:06
Size
531 B
Mime Type
text/x-c
Expires
Wed, Jul 9, 22:06 (2 d)
Engine
blob
Format
Raw Data
Handle
27226363
Attached To
R1106 Programming Concept Rouaze
exercise05-3.cpp
View Options
/*
* exercise05-1.cpp
*
/*
* Any headers you need to include should be specified on the next lines
*/
#include <iostream>
void swapVal(double *ptrA, double *ptrB);
int main(int argc, char* argv[])
{
double a = 5;
double b = 7;
double *ptrA = &a;
double *ptrB = &b;
std::cout << "Value before :"<< a << b << std::endl;
swapVal(ptrA, ptrB);
std::cout << "Value after : "<< a << b << std::endl;
return 0;
}
void swapVal(double *ptrA, double *ptrB)
{
double dmy;
dmy = *ptrB;
*ptrB = *ptrA;
*ptrA = dmy;
}
Event Timeline
Log In to Comment