Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto initialization for 3 and 4 dimensional arrays #167

Open
ziggi opened this issue May 1, 2017 · 0 comments
Open

Auto initialization for 3 and 4 dimensional arrays #167

ziggi opened this issue May 1, 2017 · 0 comments

Comments

@ziggi
Copy link
Contributor

ziggi commented May 1, 2017

1 dimensional arrays

Initialization of 1 dimensional arrays works perfect:

new array_1nd_a[5] = {1, 2, 3};

Result: 1, 2, 3, 0, 0,

new array_1nd_a[5] = {1, 2, 3, ...};

Result: 1, 2, 3, 4, 5,

2 dimensional arrays

This cause an error: error 052: multi-dimensional arrays must be fully initialized:

new
	array_2nd_a[5][3] = {
		{1, 2, 3},
		{4}
	};

I think that this should be filled with zeros, as in 1 dimensional arrays.

Also this works good:

new
	array_2nd[5][3] = {
		{1, 2, 3},
		{4, 5, ...},
		...
	};

Result:

1, 2, 3,
4, 5, 6,
7, 8, 9,
10, 11, 12,
13, 14, 15, 

3 and 4 dimensional arrays

This also cause an error: error 052: multi-dimensional arrays must be fully initialized:

new
	array_3nd_a[5][3][3] = {
		{
			{1, 2, 3},
			{4, 5}
		}
	};

But this cause other error:

error 001: expected token: "{", but found "..."
error 001: expected token: "}", but found ";"
new
	array_3nd[5][3][3] = {
		{
			{1, 2, 3},
			{4, 5, ...},
			...
		},
		...
	};

And this also cause an error: error 052: multi-dimensional arrays must be fully initialized:

new
	array_3nd[5][3][3] = {
		{
			{1, 2, 3},
			{4, 5, ...},
			...
		},
		{
			{1, 2, 3},
			...
		}
	};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants