[NXC] __VA_ARGS__

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
muntoo
Posts: 834
Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:

[NXC] __VA_ARGS__

Post by muntoo »

BREAKING NEWS

Tonight on NBC news:

Code: Select all

#define MyArrayBuild(_aout, ...) asm { arrbuild _aout, __VA_ARGS__ }

task main()
{
	int a[];
	int b[];
	
	ArrayInit(a, 42, 2) // Look ma, no semicolon!
	MyArrayBuild(b, 0, a, 1, a, 3, 4)
	
	// Display contents of b[]
	// For some reason, ArrayLen(b) == 0...
	for(unsigned int i = 0; i < 8 /* ArrayLen(b) */; ++i)
		NumOut(0, 56 - (8 * i), b[i]);
	
	Wait(2000);
}
Can John comment on this exciting new feature in NBC/NXC? Will he be able to shed some light on this mystery? What secrets will he unearth from his ancient knowledge of the Next Byte Code arts?

Over to you, John.
Image

Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE


Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests