Questions tagged as 'c'

1
answer

How to create an array function and then use it in int main by replacing values in another array?

I am having a question about how to create a function where I will use the values of an array of int main, and then how to override the values obtained in the array of the function for the array of int main? I was creating the function like th...
asked by 15.10.2017 / 23:35
1
answer

Sort an array in C

I am trying to sort an array in C. The logic I used would be to create a vector with the size of the array, copy the values there, sort the values, and then copy to the array again. To do this I use a function that receives as parameters the dim...
asked by 09.09.2017 / 14:58
1
answer

Seg Fault using strcat and strcpy

Here's my code: char CodificarCesar(char *texto_nao_codificado[256], int chave){ char alf[]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','\n','char CodificarCesar(char *texto_nao_cod...
asked by 09.09.2017 / 04:26
1
answer

Parenthesis balancing [closed]

I'm doing a C programming activity involving TAD and CELL. The purpose of my activity is to make a library ( pilha.c ) using only the pilha.h functions. In lisp.c , I want my program to receive the number of characters from...
asked by 08.09.2017 / 03:43
2
answers

Is it possible to assign the first column of a line of a / a vector / matrix?

having as example a vector of two dimensions of type char 2x2: char vet[2][2]; Is it possible to assign to the first line indices of this vector? or do they work like a pointer to the other rows and columns? I tried to do it as fo...
asked by 07.09.2017 / 22:54
1
answer

Function receives as parameter a vector of strings

I started learning the C programming language a little while ago and I'm having a hard time. I declare a vector of strings, step values for that vector, and then pass that same vector as an argument to a function. The problem is here, when I...
asked by 03.12.2017 / 00:45
1
answer

Union of Vectors in C

Good evening. I have an evaluative activity of the college to be delivered but I can not think of the logic and solve the first activity. Can anyone explain to me where my error is and advice to better understand indexes in for. I make a mess wi...
asked by 27.09.2017 / 03:18
1
answer

Problem with library math.h (undefined reference to 'sqrt')

I'm having trouble compiling the code with the sqrt() function in the C language. Error: gcc exercicio_03.c /tmp/ccGVE8ez.o: na função 'distancia': exercicio_03.c:(.text+0x142): referência indefinida para 'sqrt' collect2: error: ld...
asked by 13.08.2017 / 17:14
1
answer

Receive user vector in C

Hello everyone. I need help getting a vector of integers (separated by spaces) from the user. Here is my code: #include <stdio.h> #include <stdlib.h> #include <string.h> /*Observacoes: 1, se a ordem nao e decrescente -1, se...
asked by 10.08.2017 / 18:54
1
answer

Error creating array of strings

I'm having problems trying to initialize a vector of strings so my code looks like this: #include <stdio.h> #include <stdlib.h> #include <string.h> int main(){ char *str[3]; printf("DIGITE QUALQUER STRING: ");...
asked by 05.09.2017 / 21:47