Questions tagged as 'c'

1
answer

prime numbers between a sequence

The problem is this: I have to get an integer value and calculate the factorial of that number (even there), and pick up and print on the screen the prime numbers that exist between one and the factorial, but I'm having trouble making Can someon...
asked by 04.10.2018 / 21:33
1
answer

Could not find -lGL

I'm running the default CodeBlocks for OpenGL on Ubuntu: /* * GLUT Shapes Demo * * Written by Nigel Stewart November 2003 * * This program is test harness for the sphere, cone * and torus shapes in GLUT. * * Spinning wireframe and smoo...
asked by 24.09.2018 / 13:31
1
answer

(C) Make an algorithm that reads a string and removes vowels and whitespace

The code is copying ALL characters from one string to another and ignoring the copy condition. I know there is an easier way to remove spaces and vowels, which is bringing the next character to the current position, but the code was asked to do...
asked by 14.09.2018 / 20:13
1
answer

Why does not my bubbleSort function slowed down?

I want to call the bubbleSort code but it does not appear to run and I can not figure out the problem since it does not display any errors. #include <stdio.h> #include <stdlib.h> #include <time.h> #include <string.h> #i...
asked by 20.10.2018 / 20:58
1
answer

Code Correction in C

I made the code below that basically is to read two vectors A and B, and accumulate the values in vector C. At the end of the code, I need to show if there are repeated values and print a message to the user. If there is no repeating value, p...
asked by 24.08.2018 / 14:53
2
answers

Code :: Blocks does not print the pointer value

I developed a code in C to print the value and address of the variable x using a p pointer, but Code :: Blocks does not print the values. #include <stdio.h> #include <conio.h> int main() { int x=2; int *p;...
asked by 19.08.2018 / 17:57
1
answer

Pointers and data type hidden in C

EDIT: I'll leave the codes just below the same text. Good evening. Please see the attached image. It is the implementation of a function whose prototype is defined in another file named "stack.h". As it is, it works perfectly. However,...
asked by 17.08.2018 / 06:58
2
answers

What is the best way to clean the keyboard buffer [closed]

I have seen in several forums that you should use setbuf (stdin (NULL), or getchar I am new to C and I am in doubt on this subject     
asked by 09.08.2018 / 20:19
1
answer

Growing Order in a list chained in c

#include <stdio.h> #include <stdlib.h> typedef struct LISTA{ int dado; struct LISTA *prox; }lista; lista *insere(lista *p, int valor){ lista *novo; novo=(lista*)malloc(sizeof(lista)); novo->dado = valor; novo->prox = p...
asked by 30.08.2018 / 03:32
1
answer

Print available memory in C [closed]

How to know how much memory is available before doing malloc ? I would like to print the memory value that is still available to be able to be allocated, the code must run under Windows and Linux . On a computer I think that this...
asked by 27.08.2018 / 13:56