I've seen it doing a
MinhaEstrutura *
be explicitly typed as
typedef MinhaEstrutura * pMinhaEstrutura;
Why not always do this and get rid of having to rename?
How to release an inner% of% to a function that returns a pointer? In a simple way to try to exemplify my doubt, consider the following malloc function:
int *f(int tam)
{
int *ptr = malloc(tam * sizeof *ptr);
return ptr;
}
I...
How do I multiply the pointer as soon as I assume a value to it?
#include <stdlib.h>
#include <stdio.h>
int main (void) {
int a,*b,*c,*d;
printf ("\nInforme um valor: ");
scanf ("%i",&a);
b = &a; // Co...
I know that arrays are static elements used when you have a pre-determined size that can be used. But speaking of initialization, when the size is already set next to the array, I would like to know, essentially, why you can not use other types...
Having, for example, the following instructions:
int i=10, j=20;
int *pti, *ptj;
pti = &i;
ptj = &j;
What is the meaning of
j = pti == ptj;
and
i = pti || ptj;
?
In addition, I've read that summing the subtraction b...
There is a program I took in a company where pointers of char , type char* , and then allocated a memory for it with malloc , done the operations and in the end deallocated this memory. Usually receives all characters, up to ma...
In C ++, you can do the following:
int variavel[10][10];
int** variavel;
But when I want to create an array 2d, where can I have the first part "unlimited" and the second with limit?
tipo ponteiro nova_variavel[limite]
And the "reverse"...
In a book about C, in which I started studying variables, I would say that the variables were randomly placed in memory, for example:
int a;
int b;
printf("a = %d\n", &a); --> 5000 (endereço) (%d ao invés de %p para simplificar)
printf...
Is there any difference in the use of these 3 statements?
void addCliente(struct cliente *dadosCliente){
dadosCliente[k].nome="oi";
(*(dadosCliente+k)).nome="oi";
(dadosCliente+k)->nome="oi";
}
void main(){
struct cliente cl...