array tag

224 questions


1 answers
111 views
0
Create a two-dimensional array with new

How do I make a two-dimensional array with new?When it's a one-dimensional arrangement,int* ary = new int[Size]I wrote it like thisin a two-dimensional arrayint** arr = new int[sizeX][sizeY];I can't c...

2 years ago

1 answers
83 views
0
Which is faster, Array or List?

You need to have thousands of strings in memory that are accessible sequentially. Should I save the string to Array? Should I save it to the list? Unlike List, Array stores all data continuously in a ...


1 answers
134 views
0
To convert a vector to an array?

vector that stores doubleI want to convert double to an array that stores it.What function should I use?

2 years ago

1 answers
55 views
0
Where is the length property of the array defined?

ArrayList<Integer> arr = new ArrayList(10); int size = arr.size(); In order to obtain the length of the ArrayList in this way, the size() method is used.And String[] str = new String[10];int siz...

2 years ago

1 answers
165 views
0
What is the best way to put a char array in the string?

char[] a = {'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'};There's a string like this String b = new String(a);Is there a better way than this?

2 years ago

1 answers
62 views
0
How do you use two-dimensional arrays in Python?

Without specifying a size for a two-dimensional arrayMatrix = [][]I want to write it like this, but an error appears Matrix = [5][5]I keep getting errors even if I choose the size How do you use two-d...

2 years ago

1 answers
149 views
0
To initialize a C array

I want to initialize the same value from beginning to end when declaring an array.Now int myarr[30];for(i=0; i<30; i++) myarr[i] = 3;I'm doing a for statement like this, but not memset()myarr[all] ...


1 answers
111 views
0
Why is a[1] == 1[a] in the C array?

It's a code that my friend sent me, saying she found a weird function1[a] It compiles well and executes well.What's going on here?int main(){ int* a = (int*)malloc(sizeof(int)*2); a[0] = 1; a[1] = 2; ...


1 answers
146 views
0
Can I turn the array over with a function factor without a pointer?

int a[5][5];int* a[5];int** a;When you get an array as a factor, you have to choose one of those three and unify itIs there any way I can turn it over without using a pointer?

2 years ago

1 answers
89 views
0
Is there an easy way to initialize the entire C/C++ array to -1?

int array[100] = {0};I heard that the entire silver element is set to zero, so I thought I just need to set oneint array[100] = {-1};So the first element is minus 1, and the rest is zero.I don't want ...

« - 6 - »

© 2024 OneMinuteCode. All rights reserved.