can someone show me my mistake in this exercise?
here is my code :
#include "stdafx.h"
struct cylinder_coor
{
double r, phi, z;
};
struct car_coor
{
double x, y, z;
};
int _tmain(int argc, _TCHAR* argv[])
{
car_coor cy2ca(cylinder_coor &cy)
{
car_coor help; // help variable for composing result
// compute result
help.x = cy.r * cos(cy.phi);
help.y = cy.r * sin(cy.phi);
help.z = cy.z;
// and return it
return help;
}
double norm(car_coor &ca)
{
// return norm of vector
return sqrt(ca.x * ca.x + ca.y * ca.y + ca.z * ca.z);
}
}
You may not define a function inside an other function in C/C++/C#.
Last edited on