Visual C++ functions

  • Thread starter Thread starter Ojan Jafarkhani
  • Start date Start date
O

Ojan Jafarkhani

Guest
Hi;

I am learning about C++ functions and I confront to some problems , so I need some help.

Here is my code:

#include "stdafx.h"


int main()
{
int num1;
printf("Enter your number.");
scanf_s("%d", &num1);
printf("\nYour answer is:");
printf("%d", sqr(num1));
}

int sqr(int x)
{
int y;
y = x*x;
return(y);
}

When I run this application , I confront to the following error:

"error C3861: 'sqr': identifier not found"

What can I do to solve this problem ?

Continue reading...
 
Back
Top