Questions tagged as 'c'

1
answer

Create a c file in linux

I have a college assignment, which I am asked to implement a "C" program that produces files containing random integers of type long int , where random numbers must be between 0 and RAND_MAX . They must make files with the fol...
asked by 04.06.2016 / 16:51
2
answers

Set position Cursor Windows & Linux with same code

I'm developing a cross-platform application. For this I would like to develop with as few as possible "ifdefs", and what I need to do is basically a 32 x 16 character fixed screen. But for me to have performance, I have the need to just re...
asked by 20.08.2015 / 23:00
2
answers

Problem notes and coins [closed]

The given question required that you use scanf to read a floating-point value from 0 to 1000000 and print out how many 100, 50, 20, 10, 5, and 2 real, and how many 1-real, 50, 25,10,5,1 cent would have the value inserted. The code is reading and...
asked by 14.10.2018 / 00:17
1
answer

I get NULL from STRTOK?

Hello, I'm using strtok to split a string into words. My idea was to follow the word REMOVE deleted the next word from the text. void algorithm(node **root, char *line){ char *pch = strtok(line, " "); while(pch != NULL){...
asked by 09.03.2014 / 13:09
4
answers

Is there a smaller way to solve the question below? and know if it's correct

Create an algorithm that contains a vector of integers. Then your algorithm should generate two more vectors. The first vector must store the numbers of the initial vector in ascending order and the second must store the values of the initial v...
asked by 17.09.2017 / 22:24
3
answers

Dictionary does not return all possible words

The idea of the program is to be a dictionary, the user informs the word, the program performs a check on the characters of the word finds the position in the vector and returns the definition if the word appears in the dictionary. The problem...
asked by 17.10.2017 / 11:55
3
answers

Dynamic allocation with a void function

I made a simple code using dynamic allocation. Just ask for the size of the vector, to insert data and print it at the end I can do dynamic allocation with int , returning vet , but as I'm learning, I'm trying to do a few differen...
asked by 28.07.2018 / 23:40
2
answers

The code skips the fgets, not reading the word

The program is not reading my fgets() getting there it jumps. #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { float altura, peso,pesoidealm,pesoidealf; char sexo[10]; printf("Digit...
asked by 22.10.2018 / 20:16
3
answers

Text looks full of trash after typing

I started creating a data collection and usage application with the following code: #include <stdio.h> #include <string.h> int main() { int idade = 0; char nome[20]; printf("Hello! How old are you? "); scanf("%d",...
asked by 06.08.2018 / 00:50
2
answers

Different errors in C code in different compilers

In the following code below there is an error that the LCCx86 compiler for Windows claims to exist, but I have copied the codes of a C class I am watching. Link to the lesson for anyone interested In the C Online compiler link It displ...
asked by 31.07.2017 / 14:31