Questions tagged as 'c'

1
answer

Doubts about simple chaining in c

I wanted to know why the removal processes in threads have two pointers set to the next As this example given void remove (celula *p) { celula *lixo; lixo = p->prox; p->prox = lixo->prox; free (lixo); } Because there's always s...
asked by 18.04.2017 / 21:44
1
answer

sum summed up

This function should add the couple, but it is not, I did not understand the pq. #include <stdio.h> int somapar(int vet[], int n) { int soma = 0, i; for (i = 0; i < n; i++) { if (vet[n] % 2 == 0) soma =...
asked by 29.01.2017 / 12:53
1
answer

How is a struct organized in memory?

How does access to struct work? Can I put the members in the order I want? How does the compiler know which part of memory it should access? How would this look? struct { char ch1; short s; char ch2; long long ll; int i;...
asked by 10.02.2017 / 13:37
2
answers

Interest calculation

   [Engelbrecht et al., 2012] Develop a program that receives from the user, the value of an application and the value of the initial interest rate. Considering that this interest rate increases by 0.025% per month, then store in vectors with 12...
asked by 30.11.2017 / 22:04
1
answer

How to swap two non-consecutive nodes in a double-chained list?

I needed to swap two consecutive nodes or not in a double-chained list, but I can not. Can someone help me? I already did it on paper but it does not execute. What is the problem with the code? void swap(no_teste* A, no_teste* B) { no_tes...
asked by 14.12.2017 / 00:17
2
answers

Pass array as pointer

I need to make the proposal:    Construct a function that takes parameters from a pointer to an array, the number of rows and columns, and prints the array elements. But I'm learning pointers and having difficulties, I've tried in several...
asked by 15.11.2016 / 02:34
1
answer

Variable comparison in C, and MySql field [duplicate]

I am trying to compare the name variable entered by the user, with the value obtained in the column name MySQL . char name[45]; //declarando variável name scanf ("%s", &name); //Lendo variável name mysql_query (&mysq...
asked by 12.11.2016 / 20:45
1
answer

Standard libraries in C / C ++

What is the disadvantage of using non-standard libraries such as the getch() function and the conio.h library, what is the drawback of development using such libraries? Speaking more precisely in case of programming in C in microp...
asked by 12.08.2018 / 23:03
2
answers

What is the difference between the data types enum, struct and union in C?

I'm reading the GNU C manual and I'm in the Data Types section and I notice a certain similarity between% types of%,% with%, and% with%. Is the syntax the same, or is there something that differs between them? In which cases should I use which...
asked by 27.06.2016 / 19:59
1
answer

What is -EPERM in C?

What is the -EPERM , after which compares if the p pointer is null if(p == NULL) return -EPERM ; And I have to put these two libraries. #include <errno.h> #include <stddef.h>     
asked by 23.04.2016 / 17:28