Questions tagged as 'c'

3
answers

Append items to the beginning of a vector without affecting existing values

How do you include 3 numbers at the beginning of this vector without affecting the previous numbers? I'm trying to do this: int main() { int v[30]; int i,x; for(i=0; i < 15; i++) { printf("Digite 15 numeros");...
asked by 12.06.2018 / 03:29
2
answers

How to make an average of N numbers greater than 6

I have to do a program in C that shows in the end the average of N numbers greater than 6, but I have already exhausted my ideas on how to solve this. What I've been able to do so far is this: #include <stdio.h> #include <math.h>...
asked by 01.07.2018 / 21:07
1
answer

Why can not I print?

It's a simple code (I'm practicing pointers) It is not printing the result, the program closes ... why? ;;; #include <stdio.h> #include <math.h> #define PI 3.1416 void calc_esfera(float R, float *area, float *volume); int main(){...
asked by 27.07.2018 / 14:00
2
answers

Stopped running when I added printf

I made a source code in C, conditional, but when I add a function printf windows reports that the program stopped running. See the code: 1 : link NOTE: I USE WINDOWS 7 HOME BASIC, AND MY EDITOR AND COMPILER IS DEVC ++, IF THAT INTERFERE IN...
asked by 16.03.2016 / 14:52
2
answers

Execute the TOP command in exec in C - Linux?

Updated code, it does not execute commands #include <stdlib.h> #include <unistd.h> #include <stdio.h> void ExeclLS(int argc, char **argv) { char *args[] = {"ls", "-aF", "/", 0}; char *env[] = { 0 }; print...
asked by 07.03.2016 / 15:03
2
answers

Error in the use of else [closed]

The program is giving an error when compiling.    else without a previous if Something about else , is there something wrong with the condition if and else ? #include <stdio.h> #include <stdlib.h> int mai...
asked by 11.04.2017 / 17:54
1
answer

Code in C simply date

#include <stdio.h> #include <stdlib.h> void recebeNumCartas(int *nAlice, int *nBeatriz){ scanf("%d %d", nAlice, nBeatriz); } int achaMenor(int nAlice, int nBeatriz, int menor){ menor = nAlice; if (nBeatriz < nAlic...
asked by 16.07.2018 / 13:20
2
answers

Why is not the break working? [duplicate]

Statement:    Read a 5x5 matrix. Also read an X value. The program should do   a search of this value in the matrix and, at the end, write the location   (row and column) or "not found" message Code: #include <stdbool.h> #includ...
asked by 19.07.2018 / 07:26
2
answers

Is it always good to deallocate memory before an "abrupt" program exit with the exit function call?

When I was beginning to learn pointers and dynamic allocation of memory in C, I was told that all memory allocated in the program is deallocated when it is terminated. Ex: #include <stdlib.h> int main(void){ int *vet=calloc(10, siz...
asked by 30.09.2018 / 06:46
2
answers

Good graphic library for beginners? [closed]

Well, I know that in stackoverflow I should not go too far into the subjective when it comes to questions, so I would like you to answer given facts rather than based on your experience. Well I'd like to start learning how to use a graphic li...
asked by 28.06.2015 / 22:57