Linked Questions

2 votes
5 answers
2k views

I created a program in which I noticed two things I used the address of pointer to print the whole word and It works but when I replaced s with *s it did not work (why is this happened?) (I used ...
vgag1997's user avatar
1 vote
4 answers
2k views

I'm currently studying C++. Not in school. Using books, tutorials and practice. One thing that confuses me and I haven't been able to track down an answer is when to use the dereference operator (*) ...
MKSnazzy's user avatar
0 votes
1 answer
6k views

Mostly just the title, I want to know how I can put the random value which is a long int into an int variable address. void SpinReel(int *a, int *b) { long int reela = random() % 40; a= (int)...
Soo lee's user avatar
  • 21
0 votes
0 answers
474 views

I'm working on the C++ project where I have to overload operands in a generic class (template class). So, I have a sample class like this: template <class T> class SomeClass { private: T ...
Serhii Chernikov's user avatar
-3 votes
1 answer
113 views

I was learning about recursion using c and there was a question with an array say for example: void main(){ char str[100]; --snip-- if(*str == 'c') count++; --snip-- } ...
Shoaib Wani's user avatar
0 votes
4 answers
107 views

Given the code below: double** vr(new double*[nx]); vr[i]=new double[ny]; for(int i=0;i<nx;++i) { //Loop 200times for(int j=0;j<ny;++j) { //Loop 200times vr[i][j]=double(i*i*i*j*...
cL Maine's user avatar
1 vote
1 answer
236 views

I am new to C++, but I am curious enough to dig into these strange things. I was wondering what happens when I convert a pointer to an int and realized could they indicate something. So I wrote this ...
D3F4U1T's user avatar
  • 11
0 votes
1 answer
144 views

The below algorithm can output 99 0000 Would you please let me know how does this following line of code work? *(long*)&(st->flag1) = 0; The algorithm is: #include <stdio.h> struct ...
LAYMOONI's user avatar
-9 votes
2 answers
145 views

I got this piece of code and I have to choose the correct answer. int x = 5; int* y = &x; cout << *y << endl; And now: a)y value raised to a power b)address of the cell in which x is ...
NukaNuka56's user avatar
-3 votes
2 answers
119 views

I am trying to print out values in integer pointer. This pointer stores binary search tree keys inorder way. So my inorder function is, int traversal(int* num,node *t, int i) { if (t == NULL) { ...
jayko03's user avatar
  • 2,501
731 votes
19 answers
949k views

What does it mean to say that a parameter is passed "by reference" or "by value"? How do such parameters differ?
user avatar
90 votes
12 answers
11k views

I have seen it asserted several times now that the following code is not allowed by the C++ Standard: int array[5]; int *array_begin = &array[0]; int *array_end = &array[5]; Is &array[5] ...
Zan Lynx's user avatar
  • 54.7k
87 votes
8 answers
168k views

I read different things on the Internet and got confused, because every website says different things. I read about * referencing operator and & dereferencing operator; or that referencing means ...
Milkncookiez's user avatar
  • 7,489
83 votes
5 answers
43k views

Why and how does dereferencing a function pointer just "do nothing"? This is what I am talking about: #include<stdio.h> void hello() { printf("hello"); } int main(void) { (*****hello)();...
Lazer's user avatar
  • 95.9k
52 votes
2 answers
41k views

I'm very new to assembly, and have some very basic questions. What is the difference between these four commands? mov ebx, eax mov [ebx], eax mov ebx, [eax] mov [ebx], [eax] They say that the ...
ineedahero's user avatar

15 30 50 per page
1
2 3 4 5
8