Questions tagged as 'c'

0
answers

Order Algorithm Comparison and Exchanges Count Shell Sort

How can I count the number of comparisons and changes in Shell Sort? Where to properly use the counters? void ShellSort(int vetor[], int n) { int i , j , val, comp=0, swap=0; int gap = 1; while(gap < n) { gap = 3*gap+1;...
asked by 11.09.2018 / 15:22
1
answer

Arduino with counter

I can not understand what is wrong with this code, I was supposed to press s1 once and m1 to stay connected but it turns off after a while. The program also does not count as it should. The question is this: In the system below when a par...
asked by 14.04.2018 / 12:17
1
answer

Pass array of pointers to function

People need help in this exercise. I did the whole exercise and it runs fine only in the end it gives error because of passing the array address to the function. What's the problem here? Suppose I have to pass the address of the array, make a...
asked by 09.04.2018 / 20:12
1
answer

My program is not adding up the data it receives. C program

I need to make a program that: Get the pc model, the price of it and display the highest value, plus the number of computers without peripherals. In the main function, receive the amount of peripherals. A function that receives as a para...
asked by 10.04.2018 / 00:53
1
answer

how to print a list in C?

/* define a struct TAD lista */ struct lista { float info; /* dado */ struct lista *prox; /* ponteiro para o proximo elemento */ }; typedef struct lista Lista; I have the struct above. and the following int main int main(i...
asked by 10.04.2018 / 02:52
0
answers

Exception (9) in the Arduino IDE with ESP8266

Beacon Code: void beaconLoop() { DEBUG_SERIAL { Serial.print(F("[beaconLoop] Sending beacon on channel ")); Serial.print(wifi_get_channel()); Serial.print(" ...\n"); } DEBUG_LED blink(1, 50); hdrEspLocRequest_t hdrEspLoc;...
asked by 08.04.2018 / 11:23
1
answer

Read file from end to start [closed]

.... fseek(arq, 0, SEEK_END); while(!feof(arq)){ //fgets(&ch,2,arq); fread(&ch, sizeof(char), 1, arq); //printf("\n%c",ch); num = ato...
asked by 04.04.2018 / 21:18
1
answer

Algorithm to modify image contrast

I looked up and found some proposed calculations for the contrast modification of an image but I could not understand it straight. Could anyone give me an algorithm to modify the contrast of an easy-to-understand image without conversion to H...
asked by 04.04.2018 / 00:31
1
answer

passing a struct using extern C in a .dll c ++

I have a function that comes from a .lib that returns me a struct tabela GSTV(vector<double> inpA, vector<double> inpB); This struct is defined as follows: struct tabela { vector<int> Z; vector<double> F;...
asked by 03.04.2018 / 02:57
1
answer

Shell in C: Segmentation error and execve function, what's wrong? [closed]

#include <sys/types.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <string.h> #include <sys/wait.h> void type_prompt(){ printf("\n$~"); } void read_comman...
asked by 13.04.2018 / 17:52