Ludovic 'Archivist'
Userspace is your process
Anonymous
I don't understand the linking of streams and libraries. So, these are a bit difficult for me to understand.
Ludovic 'Archivist'
The library actually reads the files using a tool the system understands named a file descriptor
Anonymous
Ludovic 'Archivist'
The system access the data using a tool it understands named an inode
Anonymous
or a channel between CPP prog and keyboard
Anonymous
or a channel between CPP prog and a file.
Ludovic 'Archivist'
It is channel between the system and the C++ program
Ludovic 'Archivist'
And that channel is a file
Ludovic 'Archivist'
Reading a stream == Reading a file
Anonymous
can I consider a .txt or a .bin file (just supposing that I am reading from .txt or .bin file) as a File
Anonymous
?
Ludovic 'Archivist'
cin just happens to open a certain file that you write in with your keyboard
Anonymous
C++ : stream ^ | v C++ Library : file descriptor ^ | userspace (process) ---+++--- | kernel space (system) v OS : inode So where is File in the above representation?
Ludovic 'Archivist'
And inode is how your system sees a file
Anonymous
and the cpp program is at top?
Anonymous
Can you explain the above diagram yourself?
Ludovic 'Archivist'
Can you explain the above diagram yourself?
https://archivist.nekoit.xyz/a-rough-overview-of-filesystems-on-unix-like-operating-systems/
Anonymous
It's mostly not about C++ but about operating systems which is off-topic for this chat
Ludovic 'Archivist'
It's mostly not about C++ but about operating systems which is off-topic for this chat
I personally think it is required for him to understand how the language works on the inside to get what a file and a stream are
Ludovic 'Archivist'
I don't think that these details matter on his level of knowledge
Well he looks like he have the basics on CS but no idea on the practical way things work
Anonymous
I will talk later
Anonymous
going somewhere
Ludovic 'Archivist'
Giving him practice of how things work in C++ would be more complicated to explain hence less likely to be understood
Anonymous
I tried two different cases provided in this link to understand the concept of buffers in C++ Yet both work the same on my 32-bit code blocks IDE. https://www.google.com/amp/s/www.geeksforgeeks.org/buffer-flush-means-c/amp/ Please suggest corrections.
Anonymous
I tried chrono :: seconds ( 15 ) and the result was exact same on both snippets.
Ludovic 'Archivist'
The examples are not meant to be runned and for you to see the difference but to explain an actual behaviour
Anonymous
But i can't really understand until my experiment results out the same. I do not mean to offend but you need to see things to believe them.
Anonymous
Well he looks like he have the basics on CS but no idea on the practical way things work
I would love to learn the internal implementation detail. Any online resource or course on operating system?
Ludovic 'Archivist'
I would love to learn the internal implementation detail. Any online resource or course on operating system?
There are not a lot, you can read the source of OpenBSD when you are confident at reading C code
Accel
Anyone suggest me how to use chrono library
Anonymous
If a base class pointer points to a base class object and call a virtual function then will it be run-time binded or compile time binded?
Anonymous
run-time based only. when you use virtual , your class go to the vtable to check for the respective object's function
Anonymous
run-time based only. when you use virtual , your class go to the vtable to check for the respective object's function
Thanx. That means whenever any virtual function is being called then it is run-time polymorphism
Anonymous
12345 this is a number and I get this number forms of different 5! Types.get the numbers by program
Anonymous
Hiiii I was searching for a channel where i could get daily c program based chalenge can any suggestions guys or this channels will fulfill my needs
Anonymous
I am interested
Dima
No
Dima
Anonymous
Try it please
klimi
*pat pat*
Anonymous
Why isn't there any concept of virtual constructor in C++?
Anonymous
Why isn't there any concept of virtual constructor in C++?
First of all, why do you think there is a need for Virtual construtor?
Anonymous
I didn't know about virtual destructors too. Well, this is another question why is there any virtual destructor concept in CPP?
I_Interface
I didn't know about virtual destructors too. Well, this is another question why is there any virtual destructor concept in CPP?
virtual distructor needs for inheritance, for derived classes if u creating Basic class type ptr for Derived type for example
Anonymous
I know that if the base class pointer points to the derived class base *b = new Derived(); and if we do delete b; then only the destructor of base class runs and not that of the child class. That's why we need to make the base class destructor virtual for the child one to run.
Anonymous
But, I don't know the exact reason why doesn't the child class destructor runs?
Anonymous
I just know that it doesn't run.
I_Interface
I just know that it doesn't run.
man, try it on practice...
I_Interface
not only with questions
Anonymous
first: destructor for derived class second: destructor for basic class
Yes. But why doesn't the child class destructor run in above case.
Anonymous
man, try it on practice...
What do mean by practice?
Anonymous
I've seen examples of that.
Anonymous
Tell me about what happens just after we write delete b;
I_Interface
Tell me about what happens just after we write delete b;
call child destructor, then basic destructor
Anonymous
then why doesn't child destructor run?
olli
Anonymous
call child destructor, then basic destructor
If Base class destuctor is not virtual then only Base class destructor is called
Anonymous
I guess someone can brief it in a few lines. Although I am gonna surely read it later.
olli
I guess someone can brief it in a few lines. Although I am gonna surely read it later.
In a single-object delete expression, if the static type of the object to be deleted is different from its dynamic type and the selected deallocation function (see below) is not a destroying operator delete, the static type shall be a base class of the dynamic type of the object to be deleted and the static type shall have a virtual destructor or the behavior is undefined.
I_Interface
If Base class destuctor is not virtual then only Base class destructor is called
I thought if we have situation like this, basic destructor should be as virtual
Dima
Try it please
Read the rules, no assignments
Anonymous
Hello everyone. How to post to HTTPS server in C++ Builder XE7? Where I can get an example with idHTTP and IdSSLIOHandlerSocketOpenSSL1?