array tag

224 questions


1 answers
77 views
0
To enter new values for an array in JavaScript

In php, $array = array();$array[] = value1;$array[] = value2;$array[] = value3;How do I do this in JavaScript?

2 years ago

1 answers
95 views
0
Can we take any element out of the array without using the length of the array?

How do I spin random to extract any element from an array?myarr = [1,6,43,82,3,68,9,2,1]The same number is stored and you want to extract any number from this myarr. I'm using the arrangement lengthmy...

2 years ago

1 answers
78 views
0
Please help me change the elements in the array to [Element, Index]

Arrangements such as [hello, ruby, world] in ruby[Hello, [2], [ruby, 3], [world, 4] How do I change it?

2 years ago

1 answers
142 views
0
How do I create a generic array in Java?

Due to the Java generic implementation, it cannot be implemented as follows:public class GenSet<E> { private E a[]; public GenSet() { a = new E[INITIAL_ARRAY_LENGTH]; // error: generic array cr...


1 answers
133 views
0
What exception is java.lang.ArrayIndexOutOfBoundsException, and how do I prevent that exception from occurring?

What is the meaning of ArrayIndexOutOfBoundsException? How can I handle this exception?The following source code is an example of where this exception occurs.String[] name = {tom, dick, harry};for(int...


1 answers
110 views
0
For Moon, please help me

It's Java.I'm going to make a lotto number application simple.In the For Moon, where you turn the order according to the number of spinners,If you take a picture of log, there are 3, 4, and so onThe a...


1 answers
90 views
0
This is a question about the principle of temporary copying of the member variable in C++ Default Copy Generator

class baseDMA{private: char* label; int rating;public: baseDMA(const char* l=NULL, int r =0); baseDMA(const baseDMA& rs); virtual ~baseDMA(); baseDMA& operator=(const baseDMA& rs); friend ...


1 answers
82 views
0
I don't like the same number. It's an example question.

import java.util.*;public class Solution { public int[] solution(int []arr) { int[] ans = new int[100]; int cur=arr[0]; int j=0; for(int i=1;i<arr.length;i++){ if(cur!=arr[i]){ ans[j]=cur; ...

2 years ago

1 answers
104 views
0
Grammar inquiries when used as two-dimensional array parameters

1) When using a two-dimensional array as a parameter for a function, why is it that the horizontal size should be specified...?2) Usually, we receive separate values of col and row that tell us the si...

2 years ago

1 answers
118 views
0
Use a pointer to address elements in an array

#include <stdio.h>#include <string.h># # define MAX 50typedef struct contact_st{ char Name[10]; char PhoneNumber[13];} } Contact;Contact PhoneBook[MAX];int contactSwap(void* arr, int i, in...

2 years ago
« - 8 - »

© 2024 OneMinuteCode. All rights reserved.