Plz Help; Call Method(NXC)

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
onewinged
Posts: 11
Joined: 02 Dec 2011, 15:50

Plz Help; Call Method(NXC)

Post by onewinged »

Hello,
hope I won't be reported as a spam :")

I just want to know what's the code line for calling and identifying a method||function ?
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: Plz Help; Call Method(NXC)

Post by afanofosc »

Would you be willing to read the NXC Programmer's Guide or the NXC Tutorial? Or any C tutorial that you can find via Google?

Like C you simply call a function by typing its name followed by its parameters in parenthesis.

Code: Select all

// define a function
int foo(int x) { return x*x; }

task main()
{
  int x = 4;
  int y = foo(x);
  int z = foo(14);
}
I am not sure what you mean by "identifying" a function.

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 17 guests