Questions tagged as 'ponteiro'

1
answer

Why are there two const variables in the variable declaration?

I can do this: const int* const objeto = &x; Why are there two const ? What is the function of each one?     
asked by 15.03.2017 / 12:25
3
answers

Why methods that operate pointers are insecure in .NET?

Reading a little of the .NET source code I noticed that some methods have a peculiar modifier, the unsafe . [System.Security.SecuritySafeCritical] // auto-generated [System.Runtime.CompilerServices.FriendAccessAllowed] internal unsafe s...
asked by 09.10.2017 / 21:15
1
answer

Array parameter passing error

I'm trying to understand how pointers work for an array. For this, I elaborated the small program below. I made some mistake because, in the line indicated, segmentation fault is occurring. What is the correct way to pass the pointer pointi...
asked by 14.12.2014 / 17:26
1
answer

Access null pointer is not generating error

Testing the code below, I noticed strange behavior. It is working when it should not. The correct thing, in my view, was to give a segmentation fault and abort, but it looks like the compiler is doing some magic to fix the code. What happens?...
asked by 09.08.2016 / 17:37
2
answers

C ++ - Size of an array pointer

I have an array: char *exemplo[] = {"item1", "item2", "item3"}; And a function: void myFunc(**myArray) { } So, I want a function that returns the size of this array that I passed as a parameter. For example if I pass the array exem...
asked by 16.05.2014 / 21:18
2
answers

"Operator" brackets [] in creating the arrangement in C

Whenever I look for what the brackets operator [] does, even in the tables that show all operators in C, it appears that it serves to access an element of an array. However, this is not always the case, for example in the case where the a...
asked by 12.09.2018 / 16:20
1
answer

When to use void * and auto *?

C ++ 11 made us type auto ( automatic ). It can transfer type for the first time. But before him, people used to use void* , which you used to refer to on the pointer. Even today I use void* (Win32), but I also use auto...
asked by 14.02.2014 / 08:15
1
answer

Start structure pointer with an address?

I would like to know if it is possible to start this pointer type structure with an address, without needing to point to another variable, or allocate memory. typedef struct{ char nome[20]; int idade; }pessoa; pessoa leonardo; pess...
asked by 28.09.2016 / 15:09
2
answers

How to sum two integer arrays with pointer arithmetic?

I'm doing an exercise in which I pass by parameter two arrays of integers already defined by the user. I need now, in a third array, to store the sum of the two received arrays, in the same positions, using pointer arithmetic. Ex: vet 1 [1,...
asked by 12.02.2014 / 21:01
2
answers

What does it mean to create an object with an asterisk? [duplicate]

While learning programming at a reasonable time, learning C ++ with QT, I came across something I had not seen in other languages. I noticed that some (not all) objects need to be created with an asterisk preceding the name. For example: QMe...
asked by 19.06.2015 / 01:07