Questions tagged as 'c'

3
answers

Use of increments in C

What is the difference in the use of increments in language C, considering an integer N? N++ ++N N-- --N     
asked by 22.02.2016 / 23:34
3
answers

How to set a Struct to NULL in C?

I want to check if there is any content in struct so I wanted to initialize the variables as NULL , because if they were equal to NULL would know that they were not created. excerpts: Struct: struct Fila { int...
asked by 26.07.2016 / 20:08
2
answers

Query methods, classes and attributes in C language

I wanted to know if in C language and possible query available libraries its classes modules and attributes like in the Python language that there are methods dir() and help() I'm beginning to learn C and I'm kind of lost. I'll cit...
asked by 12.06.2016 / 05:54
1
answer

Getting different results with passing by value and passing by reference

I'm testing these code examples in C: Call by value #include <stdio.h> /* function definition to swap the values */ void swap(int x, int y) { int temp; temp = x; /* save the value of x */ x = y; /* put y into x */...
asked by 25.05.2016 / 03:45
1
answer

Correct use of free () in function?

How to use free() function when it is used inside a function, in this function it generates a dynamic vector and itself will be the return of the function, eg: int* copia(int *vet, int tam) { int i, *retorno; retorno = (int*) ma...
asked by 05.12.2015 / 18:25
2
answers

How to fix multiple errors in this code?

Iammakingacodethatneedstocontain3vectors(registrationnumber,note1andnote2),relativeto6students,whichmustinclude:thefinalgradeofeachstudent;theclassaverage;ono.ofstudentswithagradebelowtheclassaverage.ImadethecodeasfarasIknow,butitdidnotcompile,...
asked by 15.09.2015 / 00:17
1
answer

C socket for Linux (how to pass a struct?)

I have a client / server application and I need to transfer a struct to the server, but this is not working: typedef struct{ int pontos; int vidas; int flagReiniciar; int flagAcabar; int matriz[21][19]; } dados; send(sockfd,&...
asked by 14.09.2015 / 07:04
2
answers

Sum of checks lot, total value and validation

   Write a program in C to validate a batch of checks. The program should initially request the sum of the lot and the number of checks. Then read the value of each check by calculating the total sum. After typing all checks, the program should...
asked by 25.09.2015 / 22:01
3
answers

How the end-of-file loop is made

Type, I know that the function feof () returns 0 if it did not find an end of file and that it requires 1 parameter, which is the variable_pile_pile_FILE pointer, so far so good. If I do the while so it works like neither of the below but I d...
asked by 19.06.2015 / 16:48
1
answer

Warning in comparison of floats how to proceed

In an exercise I've made, you're asked to do a compound interest calculation with for for 5% , 6% , 7% , 8% , 9% , and 10% As I could not use a counter check the counter being a type float , or even using switch , then I c...
asked by 19.01.2016 / 00:57