C++ struct Copying Structures value

Description

C++ struct Copying Structures value

#include <iostream>

using namespace std;

struct Point3D//  w w w  .j a v a2  s  .co  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;
}



PreviousNext

Related