scammer.xyz
Hi, im new to C programming. Could any mentor in here explain the "pointers of death" in C programming? It was mentioned by my lecturer
Laxman
Hi, im new to C programming. Could any mentor in here explain the "pointers of death" in C programming? It was mentioned by my lecturer
He maybe meant "dead pointer"...Pointer is usually in one of the 4 states: dead, alive, null or out of scope. When you initialise/declare a pointer, it is in dead state. It becomes alive when you associate the pointer to an address or newly allocated memory location or assigned to another pointer. In practical programming, we always avoid dead pointers, by initialising them to NULL.  This leads the pointer to enter from dead state to null state.
Anonymous
🙏🙏🙏sorry guys
un_known_
Hi, im new to C programming. Could any mentor in here explain the "pointers of death" in C programming? It was mentioned by my lecturer
I am not properly sure but 70 can say that when you point any variable and then again you point another variable with same pointer. Then you loose your earlier one variable. In this way you can’t access again and it will also consume your memory.
Daniele°
char* deadpointer;
Daniele°
int* z=malloc(sizeof(int)); free(z); //Now z Is dead pointer
olli
char* deadpointer;
where does the term "Dead Pointer" come from? At least it's nothing defined by the standard. Pointing a an object or memory beyond its lifetime is commonly known as "dangling". And the pointer does not change with the location it points to. It can be either initialized or uninitialized.
Anonymous
How to do if I get a path to a folder I can read files from it and then read from them
Rupesh
The pointer points on address which already been freed.
Where you read? I not found even on Google pointer of death
Mihail
So that's why you didn't find anything
olli
The only reference to the term "dead pointer" comes from a user answer from quora... A pointer is either initialized or unitialized.
olli
How to do if I get a path to a folder I can read files from it and then read from them
to list the content and read the files of a directory you can use std::filesystem or boost::filesystem
Anonymous
These days people use their own term to define stuff... not sure why
Anonymous
And I am clueless...
Anonymous
Hi everyone
Anonymous
Hi Experts/Admin Have small query I'm having 10+ years of experience in C and (C++ basics). Planning to learn Java. Is it advisable??
Anonymous
It is highly advisable
Ariana
Hi Experts/Admin Have small query I'm having 10+ years of experience in C and (C++ basics). Planning to learn Java. Is it advisable??
Maybe learn c++ first? After that java would be pretty simple, along with most other languages, except for like ios and esoteric langs
Parra
Hi Experts/Admin Have small query I'm having 10+ years of experience in C and (C++ basics). Planning to learn Java. Is it advisable??
you will learn java in a week if you already know c/c++, and it can be good if you are planning to develop andriod or similar
Anonymous
What would the point of learning C++ be for him if what he wants to know is Java?
Learning more language is always good even if you dont use em
Anonymous
For example forth COBOL etc
I think that if you want to learn a language, what you may do is... to learn that language
Dima
read the rules
Pawan
👍
Nameful
Learning more language is always good even if you dont use em
Yes, certainly, but I think you should prioritise the ones you actually need
BinaryByter
BinaryByter
Yea
Nameful
I'm not
BinaryByter
its bloated, it is weird to write
Nameful
It's still used in a lot of back-ends
Nameful
so knowing it is useful
BinaryByter
It's still used in a lot of back-ends
doesnt mean that using it nowadays is a good idea
Dima
and now, all discussion about the other languages goes to #ot
Anonymous
Thankyou very much for your replies 👍😊
Tolu
yay i completed the mario problem of cs50 pset1
Tolu
but it took me hours xd
Anonymous
K
Wim
Interesting. Why?
Because it was meant as a C-version of a pascal-P kind of thing that ultimately became a huge bunch of bloatware instead; solving at runtime what C can solve at compile-time with a lot less air added to it for totally useless reasons, unless you screw up C programming as well
Darmawan
alo
Anonymous
alo
Hi Glad I found this group 👍
Darmawan
yea i'm too
Tushar
From where can I learn data structures and algorithms
Tushar
Can anyone tell me?
Tushar
Both
Tushar
/notes
Tushar
/get cpp
Tushar
#cbook
Beast
#ide
Punish3r
Can anybody tell why string size is limited to 4095 chars in cpp.? I'm facing a problem with that size limitations.
Punish3r
What alternative can i use to bypass that limitation accept array of chars. I don't want to define an array of some size.
Dima
you can’t. or use VLA.
Dima
variable length arrays
Dima
not recommended tho.
Punish3r
not recommended tho.
Can't do that. The program I am working on take string input from user. The input can be of 5 chars or 10K chars including spaces The string is limited to 4095 chars only.
Dima
use heap allocations
Dima
not fixed size arrays