Pass a Structure Pointer to a Function : Structure Pointer « Structure « Visual C++ .NET






Pass a Structure Pointer to a Function

 

#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;
struct Point {int x; int y;};
void MyFunc(Point p)
{
    Console::WriteLine(p.x);
    Console::WriteLine(p.y);
}
int main(void)
{
    Point point;
    point.x = 10;
    point.y = 20;
    MyFunc(point);
    return 0;
}

   
  








Related examples in the same category