array

Index of the first negative number of a vector

I have to make a program in C that saves the index of the first negative number, but I am not able to do. The question is thi ... if the first negative number has a [4], for example, it does not work. It only works if the negative number appears in a [0]

How to deal with vectors in a MySQL database?

I have an application that supermarket cashier in which after the end of the sale needs to enter a record with data regarding ... r something type would use something like string[] codigos = codProdutos.Split(','); (in C#), to get the data in vector form.

Print chained list in C

I am creating a program that receives a vector and creates a chained list. I need help to create the "print ()" function, whi ... aLista and deVetorParaLista return "list". How could I merge these two functions into one or use programming best practices?

Calculate vector size

How to calculate vector size? My Code: #include <stdio.h> #include <stdlib.h> int retornaMediana(int *vetor){ ... to return the actual vector size ? I have already passed by parameter, reference and nothing, I only get this 4 as an answer.

Checking Code match on a vector inside a struct in C

Next, I created a struct struct eventos { int codigo; char data[11]; char atracao[50]; int ingresso; f ... lting the first and the second listed as not registered event. If you can help me with any way out, I will be very grateful!

Largest odd number

I've spent hours trying to solve, I've started to think that the problem may be in the compiler, since it returns me a differ ... +; else continue;} return qtde_impar;} int main() { int a ; a = qtde_impar(10); printf("%i\n",a); system("PAUSE"); }

Operations with arrays in C++

To perform the sum of items of an array (primary diagonal and secondary diagonal) I was able to write the following code. Can ... { somaS += matriz[x][y]; } cout << somaS << endl; return 0; }

require once does not work

I'm trying to give require_once in a PHP file that has a class. The file I'm trying to include in PHP with the class has on ... inside the class constructor, and it worked out, now I assign $db_data to an attribute and have everything inside the class.

putting elements of a table in a list

I have an empty table , and then a javascript code that allows you to populate the table through input. What I want is to put ... .insertRow(0); var cell1 = row.insertCell(0); cell1.innerHTML = document.getElementById("nomedisciplina").value; }

What is the difference between array and array?

After seeing arrays and arrays in programming, I got a little confused, so I would like to know, what is the difference between a array and a array?

Generate random numbers in C?

I need to generate 5 random numbers in a range between -10 and +10. How could I do this ? I've seen that one can use shuffle, ... e if(num[i] < 0 ) { negativo += 1; } printf("\nPositivo(s) : %d ",positivo); printf("Negativo(s) : %d ",negativo);

Why does it accept values beyond the vector size?

INT vetor[3]; vetor[0] = 110; vetor[1] = 12; vetor[2] = 30; vetor[3] = 13; vetor[4] = 1; Cout << vetor[0]; ... know why he will perform and show the values of others? Why does the program display values that are not part of the vector?

Insert data into a vector to then print and multiply

Write an algorithm that reads two vectors of 10 positions and makes the multiplication of the elements of the same index ... for(b = 0; b < 10; b++){ printf("Vetor B: \n"); b=getchar(); } } return 0; }

Table test in Java vector

I am having difficulty solving the table test of the following code, could someone show me the output and how to do it? publ ... ry space 1 of the counter, is not it? But what about when the counter becomes 2? Do I count from 1 in memory space or from 0?

Struct vector in C

I can't find the error in this code of mine from an exercise. It prints right the first read, then prints random things. I co ... printf ("Posicao no seu TOP 5: %d \n",banda[i].posicao); } } Am I iterating wrong in reading? How would it be right ?

Maximum possible size of allocating a vector

Guys, I have a data structure project that serves to analyze search algorithms in the largest possible vector that my machine can allocate. Can anyone help me figure out how to create a vector of maximum size? The language is C++

Vector make a mysql query

Hello guys I'm trying to make a query using vector, but as far as I've learned the sql command doesn't behave the vector the ... os); Array ( [0] => BERCO CHANTILY [1] => BERCO ALEGRIA [2] => ) print_r($descricao); Array ( [0] => )

Two-dimensional array size is not being set

I created an array and put it to initialize with the values passed in the constructor, but it is not initializing. I created ... nt getColuna() { return coluna; } public void setColuna(int coluna) { this.coluna = coluna; } }

Implement a vector that accepts anything

I have to implement a vector that is capable of storing objects of any type. For example: V[3]= valor_int,valor_double,valor_ ... I was thinking of creating a method that would parse the values I want to insert, would it be the best output for this case?

How to make a search within this vector of objects?

How would I search for a record inside my object? The program is a contact book, and I wanted it to search for the name I ty ... quals(Contato.getNome())){ } } //retornar o objeto correspondente return dados; } }