Copying Structures value - C++ Data Type

C++ examples for Data Type:struct

Description

Copying Structures value

Demo Code

#include <iostream>

using namespace std;

struct Point3D//  www .  j  a  v  a  2 s.  c o  m
{
    double x;
    double y;
    double z;
};

int main()
{
    Point3D FirstPoint = { 10.5, 22.25, 30.8 };
    Point3D SecondPoint = FirstPoint;
    cout << SecondPoint.x << endl;
    cout << SecondPoint.y << endl;
    cout << SecondPoint.z << endl;
    return 0;
}

Result


Related Tutorials