Questions tagged as 'c'

0
answers

Nested Struct - Difficulty in understanding the concept

I have the following structures: typedef struct DataNode { int id; } DataNode; typedef struct Node { DataNode data; struct Node *Next; } Node; typedef struct List { int size; Node *head; } List; I made a dra...
asked by 08.12.2018 / 01:03
1
answer

Doubt - Dynamic List

I have the following structure for my dynamic list: typedef struct DataNode { int id; } DataNode; typedef struct Node { DataNode data; struct Node *Next; } Node; typedef struct List { int size; Node *head; } Li...
asked by 11.12.2018 / 02:04
1
answer

How to make a string "transformed into a number"

I have an exercise to make the user type a word and it is transformed by their corresponding numbers from the ASCII table. EXAMPLE : sara would print 115 97 114 97 this is the code: NOTE: I put a fixed value in the vector...
asked by 28.11.2018 / 15:34
3
answers

Range of random numbers in C

In a certain program, I need to generate a random value greater than 1000 (with a limit set by me for up to 5000 (maybe still a very high value)). This unique code refers to a type of registration to be performed. After solving some doubts of...
asked by 05.11.2014 / 01:09
0
answers

How to execute ROL statement in Assembly inline?

Well, I have a problem with executing the instruction to scroll left in Assembly in a C code. All the sites I search show this way, but the compiler says there are many memory references to "ROL". I've tried to execute other instructions like MO...
asked by 24.11.2018 / 20:51
0
answers

Referencing a specific element of a bidimensional matrix via the pointer notation [closed]

C allows you to treat each row of a two-dimensional array as a one-dimensional array. As known, one way to reference two-dimensional arrays in the form of pointers in C is, for example: tabela[j][k] = *(*(tabela + j) + k) According to my...
asked by 11.11.2018 / 18:12
0
answers

Reposition gotoxy (x, y) with C

I'm using the gotoxy function, so I can write in a certain coordinate: #include <stdio.h> #include <windows.h> void gotoxy(int x, int y){ SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),(COORD){x-1,y-1}); } main(){...
asked by 05.11.2018 / 12:08
0
answers

Divergence in reading

I made a sketch for Arduino MEGA, where it receives data by Serial2 and displays in the Serial, the communication happens but the byte sent is not the same as received, for example: Send 0x01, receive 0x7F Send 0x99, receive 0x33 void s...
asked by 23.10.2018 / 21:54
1
answer

Compile C ++ file in VS Code using external cmd

I can compile files in VS Code normally, however the files are shown in the terminal of the own program, which does not allow the insertion of characters. How can I configure to be able to use a terminal that allows me to interact?     
asked by 24.10.2018 / 18:07
1
answer

Difficulty implementing chessboard [closed]

I need to implement the code that manages a chessboard in ppm. It would be in the standard 8x8 format, with the user's option to set the pixels quantity, the doubt would be at the time of looping to "multiply" the pixels. In the code below it is...
asked by 01.10.2018 / 04:48