If I have already set a pointer to my structure because I can not allocate it.
#include <stdio.h>
#include <stdlib.h>
struct ponto
{
int a, b;
};
typedef struct ponto *Ponteiro; // define um ponteiro para estrutura ponto
typed...
I'm trying to pass an array as a parameter to a function as a reference, and in this function I do operations on that array but I'm not getting it. I do not want you to use define or const int for the array dimension values because...
I came across a C situation I do not know and had never seen anyone use before. Within the main() method there are several keys, I believe to isolate the code however there is a same variable that in each block of code receives a value an...
Good morning,
I wanted to know how I can optimize buffer cleaning when using the getchar () function, as an example follow the following codes:
I get the following code from the correct output using the "scanf spacing" technique as shown:...
The programming club I'm attending has completed a program that functions as a stock controller and shows things that are available and things borrowed.
It was done in pure C, so the display is quite archaic,
It looks like this: | Control...
I was given the task of making this function recursive, but I have no idea how to do it.
int existe (int x){
FILE *arq;
int y;
char buf[MAX];
arq = fopen ("cliente.txt","r");
fgets (buf,MAX,arq);
while (!feof(arq)){...
What is the purpose of the sizeof command in C language ?
I know I can use it to allocate memory and dynamically create vectors as follows vetInt = malloc(sizeof(int) * tamanho); . Otherwise this command has another function?
...
I have a question about this.
Let's say I have a floating point, with a value of 1.13 (Minutes.Seconds)
How do I get the rest (13) of the floating point?
Minutes. Seconds (Rest)
1 . 13
How do I get the floating point 13?
I need to concatenate the person's name (variable) with a text. Following logic, it would look like this
#include <stdio.h>
int main (void){
char nome[6];
printf("Ola! Insira seu nome, por fovor: \n");
scanf("%c", &nome)...
For example, the following code:
#include <stdio.h>
struct exemplo{
char letra;
int numero;
float flutuante;
};
int main()
{
printf("Tamanho do char: %u\n", sizeof(char));
printf("Tamanho do int: %u\n", sizeof(int))...