MᏫᎻᎯᎷᎷᎬᎠ
That probably will be the first time he knew that function don't change the original value
MᏫᎻᎯᎷᎷᎬᎠ
Talula
In assembly everything works with pointers... EAX is a pointer that points to any part of memory.
ECS is pointer to Code Space
ESS is pointer to Stack Space
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
CPU registers has pointers?
MᏫᎻᎯᎷᎷᎬᎠ
First time i know that
Talula
CPU registers are pointers.
Talula
not "has" pointers.
S.
pointers and integers have no difference in asm
Anonymous
Asm
Anonymous
Kya
Anonymous
Yep
MᏫᎻᎯᎷᎷᎬᎠ
▅▆▇█۩۩ąmãňî۩۩█▇▆▅
#include <iostream>
using namespace std;
// Utility function to find
int factorial(int n)
{
int res = 1;
for (int i=2; i<=n; i++)
res *= i;
return res;
}
// A Simple Function to return value of 1/1! + 1/2! + .. + 1/n!
double sum(int n)
{
double sum = 0;
for (int i = 1; i <= n; i++)
sum += 1.0/factorial(i);
return sum;
}
// Driver program to test above functions
int main()
{
int n = 5;
cout << sum(n);
return 0;
}
MᏫᎻᎯᎷᎷᎬᎠ
Dima
format your code please
Anonymous
Yeah
▅▆▇█۩۩ąmãňî۩۩█▇▆▅
MᏫᎻᎯᎷᎷᎬᎠ
Anonymous
Special
Talula
Anonymous
Symbles
Anonymous
S.
MᏫᎻᎯᎷᎷᎬᎠ
How
MᏫᎻᎯᎷᎷᎬᎠ
If I want to sum 1 + 1
MᏫᎻᎯᎷᎷᎬᎠ
1 is a pointer or a number
S.
it may store 1 in EAX, and then inc
S.
it doesn't care
Talula
Like you could say
MOV AX,9
MOV BX,[Location_Of_String]
INT 21H
This will print whatever BX is point at in (8086)
Neon
Neon
After that fight for Ur pointers
S.
MᏫᎻᎯᎷᎷᎬᎠ
Talula
Here AX, 9 means you're moving number 9 in AX
MOV BX,[Pointer_to_Memory] You're moving a pointer to memory that means a number again
olli
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
Is there any kind of symbol to help the cpu differentiate between both of them
olli
Talula
And that location is a number too.
S.
Talula
You could use it like a pointer (which is a number) or have a number which is a number.
Talula
S.
Talula
Pointer simply means a number that points to be memory location where a certain thing is stored.
MᏫᎻᎯᎷᎷᎬᎠ
Talula
What?!!
Pointer simply means a number that points to be memory location where a certain thing is stored.
olli
But then again, I would not consider a pointer part of assembly. A pointer is part of programming language to store a memory address
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
But in the cpu
MᏫᎻᎯᎷᎷᎬᎠ
Eax for example
MᏫᎻᎯᎷᎷᎬᎠ
It only stores pointers?
olli
no, "any" value
olli
a pointer is just anothre value
MᏫᎻᎯᎷᎷᎬᎠ
Talula
CPU has these pointers that are special memory area inside the CPU with a very fast memory access, I think there is EAX, EBX, ECX, EDX... I think they removed CS because in 8 bit register the memory is access using Segments... but it's not needed anymore.
MᏫᎻᎯᎷᎷᎬᎠ
It's better to have these kind of conversation in this group
olli
Talula
registers
Sorry registers... my mistake.
Anonymous
..
Anonymous
Hi
itsmanjeet
Hey
If i make a pointer
Then that cause memory leak ??
itsmanjeet
I totally don't know about memory leak
Please guide me
Mat
itsmanjeet
Google what a memory leak is
I am asking after searching
I read about gnome that its memory leaking a lot
Then i search on google what it memory leak
Gogle say that if pointer is not deleted than it is called as memory leak
Mat
Mat
A memory leak occures when there's something using memory without the need of it
Mat
Like having something you don't need
itsmanjeet
If i create a pointer in my programm and my program end
The pointer area clean automatically ??
itsmanjeet
Anonymous
AngryMethane
Hi, guys. I have a problem about exception of std::ofstream. I wrote the piece of code. It has no access to folder /var/log, but the code didn’t throw the exception.
AngryMethane