Questions tagged as 'c'

1
answer

Doubt cast struct pointer

I can not understand the meaning of this cast : the function will execute and return a type type_t , which is a typedef to void* . Then a cast is made to header_t* , which is a struct , but I can no...
asked by 23.12.2015 / 19:53
1
answer

Does anyone help me with this program in Ansi C, program CRUD? [closed]

I have already tried to delete half of the code and leave it with the first block only, but it gets error in the operators and in each scanf that I give, being that I have to find a way to assign the values I get from scanfs e play...
asked by 01.12.2015 / 03:33
1
answer

Problem with split function in C

Hi, I'm studying C language and I came across a pointer problem in a string breaking function. I use the 4.8.4 GCC version. The input value that results in an error is "1234 | 123 | 123 | 123" 4/3/3/3, other values such as "1234 | 123 | 123 |...
asked by 04.02.2016 / 16:07
1
answer

While Loop in MIPS Assembly

Good morning guys, I'm new to assembly and I'm in need of a little help if possible. I need to translate the following code into assembly: // Sendo i,total e n os registradors $s1, $s2, $s3 i=0; total=0; while( i < n ) { total=total+X[i];...
asked by 18.04.2016 / 14:31
2
answers

How to put each line of a txt file into a vector?

The file only contains 3 lines, which must be as follows: Idade = 15 Nome = Alvaro Apelido = Costa This file is only open for reading with fopen in "r" mode. So I have 3 variables declared in the code: int idade; char nome[10];...
asked by 23.10.2015 / 17:24
1
answer

Dynamic Vector + Dynamic Allocation [closed]

Good afternoon, I would like to know how to create a dynamic vector in C to store the following information: Machine Status (On, Off, Broken) | state_time_status to display on screen, as if it were a table. Ex: linked | 120.000000 sec   ...
asked by 09.12.2015 / 20:21
1
answer

Given a list of words, return the size of each group of anagrams decreasing [closed]

I have a file with a list of words, each in a line of .txt. I need to group them that are anagrams and return the size of the group, in descending order. Here is an example: cat, bed, aeds, drop, saed, toga, maca The grouping would be:...
asked by 19.09.2015 / 05:00
1
answer

Read a vector up to a stop bit

I want to read an 8-bit binary vector backwards, and stop until I read the last 1 . For example: [00010101]
asked by 19.09.2015 / 14:49
1
answer

Random letters: How to generate with rand and how to compare them in C

I'm trying to create a 10-position char array, I want to feed it with 10 random letters and sort it out with Bubble Sort. My question is: does rand generate random characters as well as generate numbers, or does it make any difference? I can com...
asked by 31.10.2015 / 22:11
2
answers

Physically delete a struct type record

I need to physically delete a record created within a struct defined in my program, but in every way I tried (Set it to NULL , Create another struct and save all records that were not deleted in it ). I registered the foll...
asked by 29.08.2015 / 15:30