Questions tagged as 'c'

3
answers

How to stop three loopings for in C

I've been trying to implement the Artificial Intelligence sorted search algorithm, and I've come to the point that I need to stop all looping if I've found the searched node. Look at the passage I made, but it does not work. I know that in PH...
asked by 09.04.2014 / 07:08
1
answer

How to make a program to calculate constant mathematical expressions [duplicate]

I have a job to build an algorithm that calculates expressions coming from a TXT file in this format. 10 + 20 * (30) / 25. I know that this is a recursive descending parser, but I have no idea where to start studying and how to do the pr...
asked by 27.10.2015 / 23:36
4
answers

Code Optimization / Image Processing

I'm doing a C-class work on image processing. And I need to find an alternative to optimize a particular piece of code. Here's how: /* Backward Rotina */ /* --------------------------------------------------------------------------------------...
asked by 14.06.2017 / 00:06
2
answers

How to create an index file using tree B +

I have a B + tree that acts as the index of a data file. This index should be saved to an index file. The struct node or node of the B + tree is: typedef struct node { void ** pointers; int * keys; struct node * parent;...
asked by 16.12.2014 / 17:32
2
answers

Error in key events in Allegro

I'm doing work from my course using Allegro as indicated. I need to capture the keystroke events on the keyboard, so I used the following: al_wait_for_event(evento, &ev); if(ev.type == ALLEGRO_EVENT_KEY_UP){ if (ev.keyboard.keycode==...
asked by 16.06.2014 / 07:34
2
answers

Where to create macros in C?

In terms of good programming practice, if I want to create a macro, for example, a macro that has more or less 30 lines of code, should I implement it in the file .c or .h ? What is good practice?     
asked by 16.07.2015 / 16:01
2
answers

How to identify a specific number in any numeric value?

For example, my variable valor has the value 1354 , note that 13 appears in this numeric value . How can I identify a specific number in any other numeric value? I would like an example in C. The following is the problem stateme...
asked by 30.08.2015 / 01:33
2
answers

Tip for code optimization in C

The way I wrote the code below is too long. How to make the code leaner? void mostrasaida(char recebido) { int dadoA [5] = {252, 146, 145, 146, 252}; int dadoB [5] = {255, 201, 201, 201, 182}; //Varios vetores de AaZ int cont=0...
asked by 26.07.2016 / 18:20
2
answers

You can concatenate numbers of type int

For example 10 and 12, concatenated would be 1012, this would not be string , it would have to be integer type, can you do that?     
asked by 08.02.2018 / 16:07
2
answers

What is happening in my C program?

I just have to add the lines but the values do not make sense: Hereisthecode:#include<stdio.h>#include<stdlib.h>intmain(){intmatriz[6][6],i,h,somalinha[6];for(i=0;i<=4;i++){for(h=0;h<=4;h++){printf("Digite os valores de uma...
asked by 12.12.2016 / 04:56