Questions tagged as 'c'

1
answer

How can I write the command to input external data in Java?

I migrated from C to Java and would like to know which command allows the user to enter external data and how that command would be in code. In language with C use the code below: scanf(%tipo_da_variavel, &nome_da_variavel);    ...
asked by 01.08.2017 / 01:04
2
answers

I'm having trouble reading a string inside a function

Good night, I would like to know methods to read a string in C (Version C99), I already tried a lot, and it does not work, below, the defective code. Note: The error I am reporting is that shortly after pressing "ENTER" on the first 'gets'...
asked by 05.07.2017 / 00:26
1
answer

Average numbers of a matrix in C

I need to create a program that builds an array and returns me the average of its numbers. I already have the array built but I can not average the values. The code I already have: #include<stdio.h> #include<stdlib.h> int ma...
asked by 16.07.2017 / 03:11
1
answer

Change pointer address in a function

I'm having trouble changing the address of a pointer inside a function. I declare the pointer inside the function, then step it by parameter to another function. This other function should cause the pointer to point to another address. The probl...
asked by 17.07.2017 / 00:42
1
answer

How to remove the first node from a list?

void Insert (List * list) { DadoNo dado; int p = list->size; No* n = (No*) malloc(sizeof(No)); n->ant = list->head; scanf("%s", dado.nome); if (Busca(list, dado.nome) == NULL){ n->dado = dado; n->prox = list->head;...
asked by 30.07.2017 / 02:28
1
answer

Vectors and Matrices [closed]

Write a program in C that decodes words from an array that contains the values of the letters of the alphabet, as below: A = 7, B = 8, C = 9, D = 10, E = 11, etc. , the code: (a) 9 7 10 7, that is to say EVERY b) 9 7 10 11, that is to say CADE '...
asked by 26.06.2017 / 20:37
1
answer

Vector of Structs for function

I'm having a problem passing a vector of structs to a function that checks whether an integer code entered by the user has already been used. #include <stdio.h> #include <stdlib.h> #include <locale.h> #define TAM 1000...
asked by 26.06.2017 / 03:55
2
answers

How to return a char vector in a function in C? type like a pointer

Hello, I'm trying to return a vector that receives the contents of an array in a function, but it's not working, thank you if anyone can help me, I'm with that doubt. Calling the function in main: char vetor[tamMsg*9]; retornar_vetor(&...
asked by 21.06.2017 / 01:57
3
answers

Reverse position / value of the vector

I need to invert one vector and store in another this way:    vector [5] = [1,2,3,4,5] < I will pass the values so       inverse [5] = [5,4,3,2,1] < It is necessary that you do so invert the values and position. My code: #include...
asked by 21.06.2017 / 04:07
1
answer

C ordering using recursion

I need to make a vector sort code using recursion. I looked into sorting methods and found two interesting ones: selection sort and quicksort. However, I tried to use selection sort and I did not succeed. Here is my code: #include <stdio.h&...
asked by 20.06.2017 / 19:23