массивы

Find the occurrence of a substring in a string in C

Please tell me: there are two arrays of characters that are entered by the user, you need to check them character by characte ... // функция вывода. { index == NULL ? printf("str1 not in str2") : printf("str1 in str2, entry index is: %d", index); }

Multidimensional array

There is an array: $cars = array( '1' => array('id'=>1, 'producer'=>'bmw', 'model'=>'x5', 'sale'=>'10', 'price ... antity'=>2) ); Thank you all for your participation, it's a pity that you can't choose several correct answers at once :)

Initializing a two-dimensional dynamic array

I am trying to initialize all the elements of a two-dimensional array when declaring it: int** ints = new int* [n] { new int ... lays -842150451 -842150451 -842150451 -842150451 -842150451 , and such: int* ints = new int[5] { 0 }; - 0 0 0 0 0 .

Are there three-dimensional arrays in Pascal, how to use them?

Is there a three-dimensional Pascal array? If so, please provide a usage example. program maasss; var a: array[1..10,1..10,1..10] of byte; begin writeln(a[5,5,5]); end. Result 0. I don't understand anything

Finding the maximum number in an array

Hello, I'm writing a function for finding the largest number in the array The algorithm: Declare the number 1 as a large nu ... } return max; } There are no errors, but it seems that the loop is just stupidly infinite though the variable count=8

How to remove certain keys from an array in php

For example there is such an array: Array ( [ID] => 4 [DATE_CREATE] => 04.10.2013 20:47:52 [NAME] => BCA ... => 4 [DATE_CREATE] => 04.10.2013 20:47:52 [NAME] => BCAA [DEPTH_LEVEL] => 1 ) Thank you in advance!

How do I create a dynamic C array?

You need to read the number N from the file, create an array NxN , and fully initialize it with 1. Here's how I do it in C++: ... while(!input.eof()) { input>>i>>j; Graf[i][j]=1; Graf[j][i]=1; } How does this translate to C?

How can I use indexOf to find all occurrences of an element in an array?

I'm implementing a program to find the first occurrence of an element in an array, but I can't figure out how to find all the ... Console.Write("The first time value on position [{0}] ", index); Console.ReadKey(); }

How do I pass an array from php to javascript?

There are two questions: 1) how to get what I need from the database. 2)how to transfer what I got from the database to javas ... part of what I plan, but it's already good that one piece is ready. I'm not a web developer at all, I work with android OS.

Deep copying of an array of java objects

How can I use the mass of objects (native, non-native)?String, Integer and so on) copy it to another array along with copies ... num + " " + massiv2[1].num + " " + massiv2[2].num); } } class Mas { int num; } Conclusion: 1 2 3 1 2 3 4 2 3 4 2 3

How do I swap array elements?

let arr = ['вс', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'] What is the easiest way to add the 0 element 'вс' to the end of the array? I got it like this: let shiftElem = arr.shift() arr.push(shiftElem) Is it possible to make it easier?

c++ Removing duplicate array elements

I don't understand how to do this removal of duplicate elements, please help. It can be seen that I wrote some nonsense after ... rr[i + 1]) { delete[] arr; size--; } } } }

Dereferencing an array pointer

int array[3]{1,2,3}; int (*ptr)[3]=&array; When dereferencing std::cout<<*ptr; (или std::cout<<ptr[0]) по ... address of the next element. Or does the array break up in std::cout<<ptr[0];, but not in std::cout<<ptr[0]+1;?

"array" in ms sql (for xml)

Hello everyone! I began to learn the query language ms-sql and as a task set for myself, I try to transfer to the xml side co ... r>8-801-555-35-35</TNumber> </Person_info> </Person_INFOs> </Bundle> </Persons>

Output of odd array elements separated by commas Java

Please help me understand : there is a method called printOddNumbers that accepts an array and outputs only odd numbers from ... } System.out.println(stringBuilder); stringBuilder.append(System.getProperty("line.separator")); } Output: 3,5,7,3,

PHP output of a multidimensional associative array

I have a multidimensional associative array. How can I display it so that everything is shown on the screen? The array is so ... : [Ханин]( [Иван] => 19) [Остроух]( [Ольга] => 18) [Кульбацкая]( [Любовь] => 25)

PHP Search for an array key by a value from a part of a word

There is such a problem. An array of data consisting of URLs: array(8) { [0]=> string(39) "/update/data?drid=2759 ... into it through strpos for the desired value, but the result is zero. Is this even possible or not? I'll be glad to any help)

Find the maximum element in the array

What is the error? #include <stdio.h> #include <conio.h> #include<stdlib.h> main() { int m=5,n=5,i,j,max; i ... [1][1]=max; for(i=1;i<5;i++) for(j=1;j<5;j++) if(a[i][j]>max){ max=a[i][j]; } printf("max a[i][j]",max); getch(); }

PHP - how to make a merge by key + value?

Array: array(2) { [0]=> array(2) { ["2020-03-27"]=> int(8) ["tags"]=> string(17 ... gt; array(2) { ["2020-03-27"]=> int(3) ["tags"]=> string(17) "STS; PTP; сервис; тест" } }

Cyclic array shift

For example, you need to perform a cyclic shift to the right by n elements. And how to make a cyclic shift to the right by -n ... rrect answer is: Array - 1 2 3 4 5 Shift to the right by -2 (negative number) Is the answer 3 4 5 1 2 or 3 4 5 2 1 correct ?