Questions tagged as 'c'

1
answer

Printing the smallest distances

The exercise asks me to print the smallest routes between n cities, considering that the last one is the same city as the starting point. First, I need to read an input file like the following: 5 1 10 4 4 5 1 2 0 7 21 Where the first...
asked by 01.10.2017 / 23:38
0
answers

Read color bytes (RGB) from a bitmap

I'm trying a problem with a code that I made that should display the bytes referring to the RGB color values of each pixel of an image in bmp (bitmap) format. I know that in windows api you have to work with bitmaps in a more practical way, b...
asked by 21.09.2017 / 17:22
1
answer

How to ignore comments in ppm P3 files?

In the function read_file_ppm_p3 (const char * filename) how would you ignore comments (# cometary) in ppm P3 files? #include <stdio.h> #include <stdlib.h> typedef struct PIXEL { int r, g, b; } PIXEL; typedef struct IMAGEM {...
asked by 21.09.2017 / 14:54
2
answers

Is it possible to create an application in C / C ++ for Android?

I want to create an Android application using C or C ++ language. What are the advantages and disadvantages of this?     
asked by 01.06.2017 / 19:59
0
answers

Arduino - Conflict function / variable / library

I'm doing a program on Arduino. I'm using the Freematics OBDII (UART) adapter. They developed a specific library. There is a problem: trying to read a PID, which returns me 2 bytes with a value between 0 and 65535. Supposedly you should save thi...
asked by 18.09.2017 / 00:29
2
answers

Incorrect value in subtraction of binary numbers using strings

I made this code and it basically gets two numbers in binaries (without separating spaces between bits), and performs (at least in the values in which I tested) the subtraction correctly. I tried to warn myself if one of the numbers is smaller t...
asked by 19.09.2017 / 18:28
0
answers

Calculate all distances

In an exercise, I need to calculate all distances between points of co-ordinates (x,y) that are read from a file, with the last point coinciding with the first point. Each point represents a city that is represented by the following struc...
asked by 28.09.2017 / 03:39
1
answer

Compare two simple strings in C, input with scanf (); [duplicate]

What I want to do is very simple. I make the program ask for a password, the program compares, and if the password is valid, the program proceeds. An example: char pass[5]; printf("insira a senha: "); while(pass!="asdfg") { //enquanto a...
asked by 20.09.2017 / 20:55
1
answer

Chained list returning empty out of function

I'm trying to read data from a .obj file and insert it into a linked list, I have a function to read and inside it I call the insert function. When I call the function to print the list inside the read function after having entered all th...
asked by 15.09.2017 / 02:27
0
answers

C Data Compression

I need to implement a C program that creates files from text files (for example, C program source code, among others). This compression will be performed using the Run Length Encoding compression method. The program should have a menu with 3 opt...
asked by 21.11.2017 / 00:55