Call a Function : Definition « Function « Visual C++ .NET






Call a Function

 


#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;

void myFunction(int val) {
    if (val < 0) return;
    if ((val >= 0) && (val < 11))
        System::Console::WriteLine("val is between 0 and 10.");
    else
        System::Console::WriteLine("val is greater than 10.");
}
int main(void) {
    int value = 25;
    myFunction(value);
    return 0;
}

   
  








Related examples in the same category

1.Pass value to a Function
2.Create a Function Prototype
3.global function