Questions tagged as 'c'

1
answer

C-maze structure

Well, I would like to make a game in C "console" but I have a question .... Basically the idea is to have a character that goes forward in a labyrinth thanks to the user, if the user type "right" the character moves to the right etc. I imagin...
asked by 22.11.2014 / 15:42
1
answer

Error in calculating values of a vector

I'm stopped at this part of my job in college case 2, the output gets all mixed up, for example:    Profit will be -1,#$%#!@ #define vetor 40 struct Produto{ char codigo[10]; char descricao[100]; float precoCompra;...
asked by 28.08.2014 / 21:29
1
answer

Store values in arrays

I'm using codeblocks, I'm a beginner in programming, starting with C, because of college. The error is this: In the snippet of the code where it stores the value of the student average, only stores the correct value of the average of the firs...
asked by 12.07.2018 / 12:46
1
answer

Runtime in C

I would like to get the runtime in milliseconds of an application, I made the following algorithm. double writingFS(char* Filepath, char* PenDrivepath, clock_t* thput) { clock_t t1, t2; long size = 0; unsigned char buff[PAGE_SIZE]; FILE* fs_f...
asked by 29.09.2018 / 21:36
1
answer

Operations with complex numbers in C - Calculation of roots of an equation by Newton Raphson's method

I have a problem in a C language program that calculates the root of an equation using the Newton-Raphson method, more specifically when the equation has complex roots. In my case, the equation I'm using will have real roots if the% constant...
asked by 14.04.2014 / 04:29
2
answers

Compile c ++ code with make

I'm trying to compile a project in C ++ using the following makefile code: OBJS = main.o src.o SDIR = ./src IDIR = ./include BDIR = ./bin/ ODIR = $(BDIR)/obj all: main %.o: $(SDIR)/%.cpp $(IDIR)/%.h g+...
asked by 27.12.2017 / 16:31
1
answer

Code does not multiply. What am I doing wrong? [closed]

I'm trying to do multiplication, but it just does not show the result of the calculation, what's wrong? #include <stdio.h> #include <stdlib.h> #include <string.h> void removerNL(char *c) { c[strlen(c) - 1] = 0; } int ma...
asked by 31.10.2017 / 22:34
2
answers

Limit, or ability of a Vector

Imagine asking yourself "when the capacity reaches the limit you should warn the user" I have a vector of integers with 15 positions, and the user will enter values in there, the goal is to warn when it reaches the end, how? #include <stdio...
asked by 22.10.2017 / 15:41
2
answers

Return and pass structure through a function in C

Good evening, I have a job of completing discipline in which I have to do registration of N employees, in my code I put 5 to get the tests faster. This information would be saved in a structure and how I would use the structure more than once...
asked by 24.10.2017 / 02:48
0
answers

Can not find -lleg (DEV C ++ and Allegro)

Staff every time I try to run this code is giving this error follow the code below: #include <allegro.h> int main() { allegro_init(); install_keyboard(); set_color_depth(32); set_gfx_mode(GFX_AUTODETECT_WINDOW...
asked by 24.10.2017 / 20:00