Questions tagged as 'c'

0
answers

Check whether the tree is AVL or not

Hello, I need to make the function verify AVL (which is called in case 8, line 364) , check whether the tree is AVL or not , that is, if the result of their nodes are -1,0 or 1, it just writes on the screen: INSERTED TREE IS AVL, if it finds...
asked by 12.04.2018 / 20:20
3
answers

What are the differences between printf, fprintf, sprintf, snprintf, printf_s and fprintf_s?

Searching I noticed that there are several variations of printf , but I did not understand the differences and which to use in certain circumstances. I would like to know the purpose of each with their differences and how they can be us...
asked by 04.09.2016 / 05:56
1
answer

Split string with comma as delimitation in Arduino Serial.read ()

I'm developing a C # application with Visual Studio which sends a character to the Arduino only I now want to send a string with this character structure, number as in the example below: A,0 or R,30 or L,15 I have to s...
asked by 26.02.2018 / 01:44
0
answers

How to check a CRC

I get 9 bytes for the serial where the last two are the CRC-16, I need to check this CRC to see if I received the block correctly. buffer[0] = 0x2E; buffer[1] = 0x83; buffer[2] = 0x82; buffer[3] = 0x00; buffer[4] = 0x00; buffer[5] = 0x00; buff...
asked by 07.03.2018 / 14:45
1
answer

Assign string value with pre-defined size within the pointer

Need help with dynamic memory, I can not understand why I can not access nome of ptr in method adicionarSocio ? How can I change this field? Do I have to malloc of the name before even assigning it already having th...
asked by 15.02.2018 / 19:04
0
answers

How to change stdout back to default?

In case I change stdin and stdout to some specific .txt, but after changing I do not know how to make it return to the normal stdout (in this case the prompt), I change through freopen as in the example: freopen (fileOutName, "w", stdout);...
asked by 10.02.2018 / 20:49
1
answer

Reading txt file to memory

I am trying to read the file that contains only 3 elements. User name: User X User Sex: Male or female User age: X age The code I have at the moment is the following: FILE* fp; char linha[500]; fp = fopen("Ficheiro Teste.txt","r");...
asked by 30.01.2018 / 14:51
1
answer

warning: initialization makes integer from pointer without cast [-Wint-conversion]

I have the following code in C that makes a connection to a mysql database and performs a query: #include <mysql.h> #include <stdio.h> int main(void){ MYSQL Connection; MYSQL_RES *res; MYSQL_ROW row; mysql_init(&...
asked by 02.03.2018 / 01:58
1
answer

Accessing array row and row-by-column switching

Good afternoon friends, I'm trying to make a swap in an array, swap values from the first row with the values from the last column. I know that a line of an array in C is a vector. I thought of doing so but as always my logic is wrong. #define...
asked by 23.12.2017 / 18:17
0
answers

Implementation of an AFD to read multiple strings

I have to determine if the strings in the file belong to the AFD. I was able to do just for a string. The goal now is to read more than one string, but I could not do the implementation, it always ends up in a loop or any other error. What ti...
asked by 14.12.2017 / 11:59