A
I am not able to understand the problems Is there Any resources that can helps to understand this better?
A
practice.. start with the easy ones
But the syntax is different So thats why I am not able to solve.. Can you please suggest another resources to understand this? Or that can help me in this regard?
Jussi
assuming big endian
How does endianness play any role in a BYTE?
Jussi
It does not
Jussi
If it was a 32-bit uint or 16-bit, then it would
Jussi
Endianness is BYTE order, not BIT order
Ludovic 'Archivist'
How does endianness play any role in a BYTE?
Excuse my tiredness, I haven't slept in quite a while
Ludovic 'Archivist'
Endianness is BYTE order, not BIT order
You are completely right on that
Neutronix
Hello guys, I'm new in C++
Neutronix
I don't understand how to connect a library in the main file
Neutronix
Could someone help me?
Anonymous
This was ignored. Someone kindly explain.
Anonymous
I got the para above the coloured region but didn't get a single thing from the coloured para and the next one? Can anyone help me explain me the last 2 para?
Deep
Anyone have notes for c++??
Anonymous
Anonymous
What is the output
Anonymous
Anonymous
Will accessing the address of register variable give compile or run time error
Anonymous
?
Jussi
Read the #rules
Jussi
## Rules #pinned * You are not entitled to an answer, getting angry about not answered questions will get you warned. * Not checking your problem in google (or any other search engine) first will get you a warn. * Asking for something that is in the pinned message right after joining WILL GET YOU BANNED. * C/C++ discussion preffered (assembly also allowed), asking about other languages (or groups for other languages) right after joining will get you BANNED. * Reverse enginnering, hacking and related topics are allowed, but asking to hack facebook, instagram, etc. is NOT allowed. Also if you ask "how to become a hacker" and obviously have zero knowledge on anything related to that you may get warned or banned. * Legitimate requests for help on code and programming questions are welcome. A request is considered legitimate if it describes your problem, what you've done so far and what went wrong. Requests such as "write my program" or "do my homework" are never considered legitimate. Asking not legitimate questions will result in a warn or ban. See https://stackoverflow.com/help/mcve on how to write good questions. * Asking for book recommendations is ok, but "pls give pdf book" is not allowed, find books by yourself. Posting illegally copied books (or links to those books) is also not allowed. * Only English language is allowed, if you speak shitty English or don't understand anything in English YOU WILL BE BANNED. * A little bit of programming related memes, jokes, shitposting are allowed. * NSFW content (porn, nudity, etc.) is not allowed. * Spamming/advertising (job posts are also ads, so ask an admin before posting) will grant you a warning or an immediate ban if you do it right after joining. * Religion, politics and ideological topics are forbidden. * Long code snippets must be posted via a snippet website(links below), posting pictures of code and posting long snippets in the group is not allowed. * If you encounter a problem, while using turbo C++, you will not be helped, use another more modern IDE. * Don't post compiled executables, that is obviously a security risk ## Resources About asking good questions: * [English](http://www.catb.org/esr/faqs/smart-questions.html) * [Translations](http://www.catb.org/esr/faqs/smart-questions.html#translations) For posting long code snippets: * [GitHub Gist](https://gist.github.com) * [Ubuntu Paste](https://paste.ubuntu.com/) * [Pastebin](https://pastebin.com) ## Reports If you notice any forbidden content, please use the /report command while responding to the offending post to report it to the admins.
Here
Anonymous
Me ? Which does mine fall under ?
Jussi
"Requests such as 'do my homework'..."
Anonymous
no no it is not a homewok question
Jussi
Well why cant you just compile the program and see for yourself then?
Anonymous
it is just a mcq that came in my question paper
Jussi
mcq?
Anonymous
multiple choice question
Anonymous
I want the reason not the answer.
Anonymous
reason for the "char *p = 0;"
Mat
No pictures of screens. They're not easy to read
Mat
reason for the "char *p = 0;"
That's a pointer initialization
Rumpelstiltskin
Could someone help me?
Just include your headers uding #include directive
Alexander
ide
Alexander
/get ide
klimi
@Del4gen explain yourself or i am gonna ban you
Anonymous
can someone dig deeper on this: char *p = (char *)0;
Tim
how can i store the output from valgrind to a files
YVEF
Hi everyone. Anybody here use WinApi?)))
Dima
YVEF
Haha
Anonymous
It's just assignment of null pointer
Anonymous
And it's an old-style way
Dima
top 10 gross things: 0. winapi
Anonymous
T* ptr = nullptr is a c++11 way
Dima
0 is nothing
Anonymous
0 is integer then what does (char*)0 mean inside the memory?
Dima
null - 0
Dima
whoever wrote (char*)0 must be retarded
Anonymous
I don't know who wrote that but this confuses the noobs
Ludovic 'Archivist'
T* ptr = nullptr is a c++11 way
std::unique_ptr<int> ptr; is even better
Anonymous
It's just casting to a char pointer At machine level you don't have types at all Types are a high-level abstraction
Anonymous
std::unique_ptr<int> ptr; is even better
Sometimes raw non-owning pointers are ok
Anonymous
LMAO
Anonymous
Is this right ? when we write char *p = (char*) 0; then 0 is being type casted to char*.
Anonymous
how does (char*)0 mean NULL?
Anonymous
Anonymous
so what does "0 is being type casted to char*." mean?
Anonymous
how does (char*)0 mean NULL?
No, NULL is an integer in C++ and void* in pure C
Anonymous
I would have understood had it been some integer pointer in place of 0 but seeing 0 confuses me.
Anonymous
In c++ it's just #define NULL 0
Anonymous
okk
Anonymous
0 and null mean the same?
Anonymous
Yes
Anonymous
int i = 9; int *p = &i; and then char *c = (char*)p; is understood
Anonymous
so what does "0 is being type casted to char*." mean?
"A value of a type T1 is being casted to a type T2" means you can use operations associated with the type T2 on the value
Anonymous
but (char*) 0 is not understood
Anonymous
it means that c will now point to the first byte of the 8 bytes to which p was pointing to. means that *(p+1) would give the value of location present at "(address of i) + 4 or 8(architecture dependent)" and *(c+1) would mean the second byte of these 8 bytes which are occupied by the variable i.
Anonymous
so *(c+1) increments by 1 and prints the value whereas in case of *(p+1) increments by 4 and prints the value which will be some garbage in this case.