Questions tagged as 'matriz'

1
answer

How to read a variable of type unsigned char by the function fscanf?

I am reading an array from a file where each element of this array ranges from 0 to 255. For this reason I have stored the values inside an array of type unsigned char, but I am encountering some problems with respect to which specifier to use....
asked by 18.04.2017 / 15:44
1
answer

How to Assign a Phrase to a row in an array of chars?

I want to modify standard phrases from a theoretical game. For example, the game has the phrase "Choose a command" and, over a given state, you would like to change all the letters "o" and "a" by an @. For this, I thought about implementing a...
asked by 04.10.2018 / 18:26
3
answers

Print Vector in C

I would like to start a vector [300] and another [500], but in a way that looks like an array for the user ... for example, I made one of [100], where I looped to start this vector and an "if" for it to break the line so that when it arrived in...
asked by 13.12.2018 / 03:00
2
answers

Check the diagonal of a specific index

I wanted to know how to check the diagonal of a particular index, for example, put 1 in all diagonal numbers of row 2, column 2 0 1 0 1 0 0 1 0 0 1 0 1 1 0 0 0     
asked by 11.12.2015 / 15:27
1
answer

Insert n points of a vector randomly into any array in java [closed]

I am a beginner in Java, I wanted to know if there is any function that would make my life easier: Having a vector of n positions filled with (pre-defined) numbers, distribute those numbers in randomly array positions. For example: havin...
asked by 28.08.2018 / 04:09
1
answer

Two-Dimensional Matrix Matrix Problems

My goal in this exercise is that in each loop to make a new snack request, the reported data is appended to the final table (array [i] [j]). In the second "for" is where I try to assign the variables [int cod] [char snack] [int price] into the a...
asked by 05.09.2018 / 21:37
1
answer

Draw of positions of an array

I need to create a function to sort within an array full of 0 with size n x n, four positions to modify the value of only those positions drawn.     
asked by 05.04.2018 / 18:45
1
answer

Make a function that receives a matrix A (10,10) and returns a vector with the sum of each of the lines of A

I'm trying to solve this problem. #include <stdio.h> /* 5. Faça uma função que receba uma matriz A(10,10) e retorna um vetor com a soma de cada uma das linhas de A. */ int matriz[3][3]; void soma() { int i, j; int so...
asked by 15.06.2016 / 00:55
3
answers

I need to make a function that passed an array n * m, be transformed into a one-dimensional vector of n * m

int* Vetor_Unidim(int **matriz, int n, int m){ int *vetor = (int*)malloc((n*m)*sizeof(int)); int *p; p = *matriz; int tam = n*m; int i; for(i = 0; i<n; i++){ p = matriz[i]; for(j= 0; j<m ; j++, p++){...
asked by 08.07.2018 / 23:34
2
answers

fill an Array with data up to a specific value

I need to make a program that reads the keyboard names until the user types the word "end", and then prints the names typed in the order they were typed. So far, I have tried to resolve this issue using ArrayList , like this: public c...
asked by 09.10.2015 / 20:35