Questions tagged as 'array'

2
answers

Return a random value from an array

I am trying to get a function to return a random string from an array of strings but it looks like I am not passing the parameters to the function correctly. The problem is in the main.cpp This is my code: Player.h #ifndef PLAYER_H #defi...
asked by 14.06.2018 / 13:26
2
answers

how to make a step by reference of two-dimensional array to the constructor?

My program has a problem in being able to make a step by reference of two-dimensional arrays to the constructor of the class ||=== Build file: "no target" in "no project" (compiler: unknown) ===| C:\Users\pc\Downloads\Matrices-Costructores.cp...
asked by 20.05.2018 / 20:55
2
answers

Error trying to create an array for types of a own Class

Hello, Good morning, everyone. I want to assign a new data type of an array, for example: I want my Array to be of the Person type, but it throws me an error, I've tried it in different ways. I do not know if this can be done? One of th...
asked by 20.04.2016 / 18:07
3
answers

Validate values of an array in php

What I need is to validate that at least one position of an array is NOT NULL. For example, I have an array that contains search criteria, that after a process, becomes NULL or with a search value, then I need to validate (before sending to proc...
asked by 12.05.2018 / 10:44
2
answers

The line of the printing code does not print well

I made this code when I asked for the data, but afterwards when I want to show the data I asked for the printout goes wrong, could you please tell me what I have to do to make the printout please. I leave an image so that they see the final impr...
asked by 03.09.2018 / 02:54
2
answers

PHP: Take value of an arrangement inside a while and send it to another page

I have a problem. I need help to traverse a while and take the value of an array that is full of data from a database. I need to take some value and send the data of that arrangement to another page. I leave my code here: <?php while($ro...
asked by 01.08.2018 / 18:17
1
answer

Make another of another kind by its constructor, error

Good morning, today I am trying to make a program which consists in entering the name of the participants of an athletics race, entering their departure time and their arrival time. Previously in class we had made a program that has the Time...
asked by 25.09.2017 / 16:43
2
answers

Convert String to matrix

I have this string in Java String str = "a, b, c, d, e, f, g, h, i, j, k, l, m, , n, o, p"; And I need to convert it into a matrix where the rows and columns are specified. That is: 3 by 3 a b c d e f g h i O 2 for 8 a b...
asked by 01.04.2018 / 08:24
1
answer

Problems when storing strings of a class in an array

My program consists of a menu that has: Register. Unsubscribe. Modify. Show. Exit. And the Person class with its constructors and methods. The Person class is something like this: Class Persona{ private: char* dni; char* nomb...
asked by 03.05.2018 / 12:46
4
answers

How to perform mathematical operations with the values of an array

I have a problem subtracting the values of an array from one another. The sum works perfectly, but the subtraction does not work. It always makes me negative numbers, and that would not be the case. This is my code: var numbers = []; var u...
asked by 17.06.2018 / 13:01