Questions tagged as 'array'

1
answer

Print all results of a vector with a certain value

I'm starting the studies in C. I have a question about how to go through a vector looking for a value in it and print showing with printf all the values found. The program I'm doing: link In the above program, it would be case 5,...
asked by 30.11.2016 / 12:18
1
answer

How to create an array with months

Good afternoon, I'm maintaining a code that shows a graph, the X axis presents the last 11 months and the current month, who wrote it manually entered the months and wanted to automate it, I thought to do it as follows : $meses = array(date(m)...
asked by 28.11.2016 / 16:40
5
answers

Remove last comma from an array

In this code below I have an array that returns me a comma at the end  exe: '98602', '98603', '98604', How can I remove this comma? if (isset($_POST['checkbox'])) { foreach ($_POST['checkbox'] as $key => $value) { $id = mysql_re...
asked by 06.03.2015 / 16:09
1
answer

How to return to the beginning of an Array in C #

I have to develop a code where it does the Cipher of Cesar encryption, the characters that I should use should be in this sequence; A ~ Z, (whitespace), 0 ~ 9. I already developed a lot of the code, but I came across a problem; for (int i = 0;...
asked by 23.11.2016 / 17:14
2
answers

Divide vector according to delimiters and copy content to other strings in C

I need the main string "vector" to be traversed to the delimiter '=' and copy the previous values to '=' to 'second' and values after '=' to 'third'. Sure there is a smarter way to do this, but since I'm a beginner, I'm having a hard time figuri...
asked by 26.09.2016 / 06:51
0
answers

How to know the index number in a multidimensional array? [closed]

Information: Rooms: 25; Teachers: 4; Q02, Q03, Q04: A student in a class ranked the teacher from 0 to 10. From these numbers, an average was generated. There is a select with the list of teachers, and when one is selected, I need to displa...
asked by 21.09.2016 / 17:28
5
answers

Remove last comma from an array

In this code below I have an array that returns me a comma at the end  exe: '98602', '98603', '98604', How can I remove this comma? if (isset($_POST['checkbox'])) { foreach ($_POST['checkbox'] as $key => $value) { $id = mysql_re...
asked by 06.03.2015 / 16:09
1
answer

Return 2 PDO queries in JSON

I need to return two queries. $id = $_POST['id']; $id = end(explode('editarnovoservico', $id)); $searchid = $pdo->query('SELECT * FROM cad_servicos WHERE id = '.$id); $searchid = $searchid->fetchAll(PDO::FETCH_ASSOC); $searchtiposervico...
asked by 30.07.2016 / 02:09
0
answers

Error filtering form values by comparing two arrays

I'm trying to filter the values of fields filled with an array, ie check if a string of an array is contained in any of the values coming from a form. Problems: Only the first field is successfully being filtered, the second and the third...
asked by 19.07.2016 / 00:02
0
answers

Store array in the database and recover using one of the array information [closed]

I need to develop a system where I capture the selected data from a checkbox and insert everything into a array , I believe this is the most appropriate method to store, and then send it to the database, and time to retrieve the dat...
asked by 10.07.2016 / 03:18