Questions tagged as 'c'

1
answer

error while zeroing a string

I'm in a problem in my code where when I zero the string and add new words it just stores the first part codefollowsbelow:printf("Digite o nome do seu laboratorio:\n"); gets(nome_lab); printf("O nome do laboratorio eh: %s.\n", nome_lab); pri...
asked by 22.07.2017 / 23:30
2
answers

Doubt over struct and list in c

I'm in trouble when I need to give a person value, in this case I need to give the name and age value to the person. I tried to create a struct PESSOA and a list that contains a person and an id, but during compilation it presents / displ...
asked by 05.08.2017 / 20:47
2
answers

Problem with recursion and pointers

I'm having trouble solving the following question:    Make a recursive function that allows you to sum the even elements of a vector of integers, you must use pointers to traverse the vector My code is not performing the correct calculati...
asked by 16.10.2017 / 16:54
2
answers

Continue "from while" of last point

There is a program of registrations that I have to make, I put the registration options and so on. All the code is saved in the vectors and they are as expected, but when I return to main() , it returns to number 1, since I had to initiali...
asked by 19.10.2017 / 18:34
1
answer

How to use OpenMP Lock Routines?

I need to create 5 easy-to-understand algorithms for each of the locking functions below in C or C ++ to be able to exemplify the operation of each and present to the staff in my room. omp_init_lock_with_hint omp_init_nest_lock_with_hint...
asked by 14.05.2017 / 19:36
2
answers

How to get all the digits of a variable in C?

I have to do a function that tests divisibility by 3, return% with% if it is divisible by 3. Otherwise return% with%. Following the rule: A number is divisible by 3 when the sum of its digits is divisible by three. I have the following vari...
asked by 09.05.2017 / 07:37
1
answer

How to store the return value of a function in a local variable in C?

I created a function that returned a certain value, when I use this function in the main function of the program, how can I do to store the return of it, and for example, display that return in printf in main ? #include <...
asked by 15.05.2017 / 21:41
1
answer

Comparison of char variables

I'm developing a program that needs to read a variable in char and compare it with another char . However, when performing comparisons using the strcmp(typed_pass, correct_pass) function, regardless of the text obtained throu...
asked by 17.05.2017 / 03:51
1
answer

How to display only negative values in C?

I have three variables: int numero1,numero2,numero3; Once you have declared them, I am asked the user to populate them: printf("Digite o primeiro numero inteiro: "); scanf("%d", &numero1); printf("Digite o segu...
asked by 29.03.2017 / 06:36
3
answers

Insert data into a vector to then print and multiply

   Write an algorithm that reads two 10-position vectors and   multiplication of elements of the same index, placing the result in   a third vector. Show the resulting vector. I wanted to show the values you entered first, and then start the...
asked by 14.03.2017 / 14:12