Questions tagged as 'c'

1
answer

How do I assign the strtok return to an array of strings?

Well, I was testing the strtok function, but it's giving me this problem of "segmentation failure (recorded core image)". Before I tried to strPtr [i] = strtok (str1, str2); but gave this error:    "error: assignment to expre...
asked by 28.12.2017 / 23:04
3
answers

Error returning lower value

I'm trying to return the smallest value using va_args , which supports multiple arguments, but it always returns the same number: -13227; #include <stdio.h> #include <limits.h> #include <stdarg.h> int minimo(int args,...
asked by 02.01.2018 / 21:46
1
answer

Error with array in C - arduino

I'm having an error signing an array: Menu m = Menu(); m.Options[4] = {"teste1","teste2","teste3","teste4"};//Erro aqui m.Show(); Menu Class: class Menu { public: String Options[]; int index = 0; int len = 0; String Show()...
asked by 23.12.2017 / 15:09
1
answer

Cast on void pointer

The code below was working as expected, but I changed the info type in the structure List from Retangulo* to void* and tried anyway to cast but continue with the following error: t.c: In function ‘imprimir’: t.c:40:38: warning...
asked by 04.01.2018 / 04:07
2
answers

Definition of Struct in C

Hello, my teacher made the following definition of some structs for a code from a list in data structure, but unfortunately I can not understand the definition of each struct itself. typedef struct{ int Chave; }TipoItem; typedef struct Tip...
asked by 06.12.2017 / 01:59
1
answer

Graphics with noise in arduino no plotter

Implement code that simulates the speed of a car as a signal plus noise, with 50 elements. The speed value increases linearly from 0-50 km / h. The noise amplitude is ± 1 km / h. The values are sent to the console with a precision of three signi...
asked by 12.01.2018 / 13:17
1
answer

Difficulty in updating global variable. W

I am developing the following code and I am using global variables that can be changed in different parts of the code, but when I change for example the state variable in the menu () function its value is not changed in the other functions that...
asked by 28.11.2017 / 01:21
1
answer

Passing array to function by reference

Good morning everyone, I want in my code to leave the Main (); only with function call, all work is divided into small functions in the document. I want to write an array [3] [3] in a function and organize and print it in other distinct funct...
asked by 20.12.2017 / 13:18
1
answer

How to transform into a lowercase a value of a struct?

The next function should turn variables into lowercase and then compare them. I've tried converting before, but also bugou . Arithmetic use of pointers next to variables of struct . Pointer points to struct . How to fix the error...
asked by 02.11.2017 / 04:01
1
answer

Converting int to string

I made a program that simulates a login and when I convert the password that is in int to a string using sprintf it's from the failed segmentation, I tried to use the itoa but it's the error definition #include <stdio.h> #include <std...
asked by 04.12.2017 / 20:35