Anonymous
im using blocking sockets and when I accept() and recv() until > 0
i cant write or send() after without the socket closing
but if I recv just once, and the write/send it works?!
but i dont get all of the incomming packet before i respond, which is a little useless
Any idea whats going on?
Anonymous
Hi Rose
Anonymous
Guys any one can give explain of 32 bit addressing and 64 bit addressing
Anonymous
In memory management of c variable
BinaryByter
BinaryByter
if your pointer has 32 bits, you can access at most 4Gigabytes of ram
BinaryByter
but if your pointer has 64 bits, you can access more gigabytes
BinaryByter
for this reason, 32 bit pointers are obsolete
Anonymous
Yess
BinaryByter
excellent question!
Anonymous
I am confused why size of(&p) show 8
Anonymous
Using int has 4 bytes
Anonymous
Yes but address operator take more memory
Anonymous
Why
Anonymous
Storing address of int type in pointer
Anonymous
Has 8 bytes
BinaryByter
what?
BinaryByter
show me the exact code you ran
Anonymous
Hold on
Anonymous
#include<iostream>
using namespace std;
int main()
{
int number = 100;
int *pnumber;
cout<<sizeof(&number)<<endl;
cout<<sizeof(&pnumber)<<endl;
cout<<sizeof(number)<<endl;
cout<<sizeof(*pnumber)<<endl;
}
Anonymous
OUTPUT:
8
8
4
4
BinaryByter
BinaryByter
but here you don'T take the pointer of number
BinaryByter
what you take is the value at position pnumber
Anonymous
Means?
Anonymous
Anonymous
Yes
BinaryByter
and when you do
*pnumber, you take the value at position <pnumber>
BinaryByter
which is then casted to int
Anonymous
Yes
Anonymous
Yes
BinaryByter
and int is of size 4
Anonymous
Yes
Anonymous
But & operator show different
BinaryByter
because there you take the pointer to the int
BinaryByter
and pointers are (atleast on your system) 64 bits big
Anonymous
What about of 32 bit
BinaryByter
on an old system, &pnumber would be 32 bit
olli
You should remember, a pointer to a type is different than the type itself
BinaryByter
^^
BinaryByter
is a house number a house?
Anonymous
Olli can you give more details please
BinaryByter
is the size of a house and a house number the same?
Anonymous
Is there is any reference for 32 bit and 64 bit addressing
Anonymous
No
Anonymous
BinaryByter
same happens here
BinaryByter
think of pointers as house numbers to variables
Anonymous
Anyone in the group about Telegram api?
Anonymous
@linuxer4fun when assign the address to pointer it take hexadecimal
Anonymous
But & show 8
Anonymous
i use api in c#. but sometimes don't send respons to updatehandels method. if i click button it work. but in code in while after some run. don't send any update.
BinaryByter
Anonymous
But if I click immediately in button it's work
BinaryByter
you can assign a decimal to the pointer
Anonymous
So then
Anonymous
Decimal?
Anonymous
How
BinaryByter
int *myPointer = (int*) 100;
BinaryByter
for exaymple
Anonymous
But whenever I get the address it's hexadecimal type
BinaryByter
thats how Cout represents it
BinaryByter
there is no "hexadecimal" type
BinaryByter
in ram, everything is binary
Anonymous
Ohhh
BinaryByter
yep
BinaryByter
0b10 = 2
BinaryByter
for example
BinaryByter
its the exact same thing
BinaryByter
its just that its written out differently
Anonymous
& is type of what
BinaryByter
& is the memory adress of a variable
BinaryByter
and its a pointer type
BinaryByter
(64bits)
Anonymous
So when I initialized the int variable it take 4 bytes so it's equivalent to 4 registeres in memory
BinaryByter
no
BinaryByter
registers are not bytes