I want, when I run the program, every button I’ve created (later buttons will be more) to have random String text from the array, which I’ve initialized. I don’t know what I should to do . The language is c++ . Thanks for the help in advance. My array looks like this: using namespace System; ..

#### Category : arrays

I have been given some integers and I have to count the frequency of a specific digit in the number. example input: 5 447474 228 6664 40 81 The first number says number of integers in the list. I am finding frequency of 4 in this case. I tried to change the integer to an ..

write a c program to calculate the mean of given array in which an array X and an integer S, how many contiguous fragments of X has arithmetic mean equal to S? For instance, given X=[4,3,6,2,10] and S=5 result is 3. [4,6] , [3,2,10] and [4,3,6,2,10] has the mean 5. Source: Windows Que..

I have a struct struct RGB { int r; int g; int b; } I know that aggregate initialization can be used: RGB rgb = {255, 255, 255}; I wonder if it is possible to initialize it using an array. I’ve tried these solutions and they do not work: int rgb_array[] = {255, 255, 255}; ..

I have a struct struct RGB { int r; int g; int b; } I know that aggregate initialization can be used: RGB rgb = {255, 255, 255}; I wonder if it is possible to assign an array to it. I’ve tried these solutions and they do not work: int rgb_array[] = {255, 255, 255}; ..

Let two arrays arr = [1,5,6,3,10] rank = [100,0,1,100,2] Based on the rank array (Which holds the ranks of the mirror elements in the arr) the result should be [5,6,10,1,3] The first element in the result is 5 (The index of 5 in arr is arr[1] and the index of 0 in rank is rank[1]. ..

Good day, I’m new to intrinsic in cpp and I’m still trying to learn it, I just want to ask how can we load an array of int on a __m128i variable, and perform addition with it, then store it’s values into another array of the same size? This is the working function that I ..

I have a csv file called "input.csv" (UTF-8, no CR, LF only). It looks like it has 51 rows and 3 columns. I have to read the csv file and perform some mathematical operations on the data. I have tried couple of codes to read the csv file in c++ but none of them seem ..

I have this code: int a[4][4]= { {1,2,3,4}, {5,6,7,8}, {9,10.11.12}, {13,14,15,16} } And I want to initialize B which is defined as below: vector<vector<int>> b; I know that I can do this with two loops (and possibly with one loop as documented here: https://stackoverflow.com/a/4092996/654019 But is there any way that I can do this without ..

You are given a read only array of n integers from 1 to n. Each integer appears exactly once except A which appears twice and B which is missing. Return A and B. Here is the solution tried : vector<int> Solution::repeatedNumber(const vector<int> &A) { int n=A.size(); vector<int> res(2); unordered_map<int, int> m; for(int i=0;i<n;i++){ m[A[i]]++; if(m[A[i]]==2) ..

## Recent Comments