Questions tagged as 'c'

3
answers

How to search in a String and replace X with a number and use the same to calculate?

I'm creating a program in C to do the Newtow-Raphson method, it should calculate automatically for the person. However in a part of the method the automatic substitution of values in the function as for example below should be done:    f (x)...
asked by 06.11.2016 / 04:19
3
answers

How to dynamically increase the struct size?

How can I increase the size of the struct when the current size is reached? #define TAM_MAX 50; typedef struct{ char nome[TAM_NOME]; /* nao pode ser vazio*/ char sobrenome[TAM_SOBRENOME]; char telefone[3][TAM_FONE]; /* mo...
asked by 06.11.2016 / 17:31
1
answer

Capture Strings Started with% t and% u

What modification can I make to capture the humidity and temperature of my serial port to insert a variable inside the variable that is printed on the serial port as% u0000 and temperature% t00.00. Generally with unique characters, example 'O...
asked by 26.09.2016 / 01:15
1
answer

How do I leave this list double-chained and circular?

#include <stdio.h> #include <stdlib.h> #include <string.h> struct Tipo_Lista{ char cod[50] ; struct Tipo_Lista *Prox; struct Tipo_Lista *Ant; }; struct Tipo_Lista *Primeiro; struct Tipo_Lista *Ultimo; void FLVazia(...
asked by 11.08.2016 / 16:40
1
answer

Problem in code in C executing a function

Hello, I have a problem with this code. I'm implementing the bubble sort function. But something curious happens when running this code. The variable n that indicates the amount of vector space in the main function is modified after executing th...
asked by 27.08.2016 / 03:17
1
answer

C Register system saving on file

Here's my code. I believe the procedures to receive strings, receive the information and insert into the global vector are working, but the program stops working while selecting the option to list, so a structure is added in the global vector....
asked by 16.06.2016 / 18:25
1
answer

What are the differences between BUILD_STATIC_LIBRARY and BUILD_SHARED_LIBRARY?

When trying to compile, I came across these two options, in my case only one worked, which led me to the questions: What could one have that the other does not have? What advantage, and disadvantage in using BUILD_STATIC_LIBRARY or...
asked by 23.06.2016 / 04:37
1
answer

Integrate C and C ++

Good morning everyone. I have a main program in C, and I just want to call a function that is in another C ++ file and get the return of this function. How do I do this? I researched and saw that "extern" can help but I am not succeeding....
asked by 07.06.2016 / 16:13
1
answer

My code in C contains some errors (Data Structure List)

I created a Music Player for a Data Structure discipline using Double-Chained and Circular List. However, it is showing some errors and I can not see where. Can anybody help me ? Maybe it's logic error and / or syntax error. The play option s...
asked by 21.03.2018 / 23:44
1
answer

How to Calculate CRC Modbus RTU

I'm trying to calculate a crc modbus in an application for PIC, but the crc returned is always incorrect compared to online simulators .. follow the code void CRC (unsigned char* msg, unsigned char* out) { //char CRC16[2] = {0xFF,0xFF};...
asked by 28.03.2018 / 19:05