That helps; thank you for the insight.
That helps; thank you for the insight.
Marc Deop wrote:
They write in C because it's *faster*
Rubberman wrote:
It may be possible to write kernel modules in C++, but it would be so restricted that it would end up pretty much just C code.
Thanks for your feedback.
However, to elaborate a bit more, my thoughts were that:
as [far as I could see] the Kernel writers continue to write it just in C, and they presumably do so because they regard it to be better than C++
and so shouldn't I just follow their lead and not bother with continuing to try to learn C++?
If it's not: [arguably] better than C++ (and your replies suggest to me that it is not), then whatever are their reasons for continuing/[prefering] to write it in C?
Hello.
I've just realised that all the headers mentioned in the Manpages are of style: something.h
From what I've been reading, I gather that they are all therefore C headers.
Am I correct?
If so, then what is the merit as an [exclusivley] Linux user in my learning C++?
Thanks
I'll certainly carefully read the manpages.
There's no RAID, no drive cards - it's just an ordinary system.
As a first time user of SHRED I wanted to be sure that things would work EXACTLY as expected.
Just as well too!
So, I made a small partition of 8MB, zeroed it out, formated it to ext2, & stored a load of text files in it.
Then:- I used dd to copy an image of the partition to a file (a), SHREDed one of the text files in the partition [using the zero-out-after and the leave-the-name-in-the-directory options] and then made another image-copy of the partion (b).
Clicking on the filename in the file manager the file opened as a 'nil' document [so far so good].
Using KHexedit I then looked in both (a) and for (b) for the file; it was in both!
So I did 'sync' in a shell root terminal, made another image-copy of the partition and looked again, - still there! =(:-o
So then from the file manager, I opened the the 'SHREDed' file modified it, saved it, made another image-copy of the partition and looked again for the original file, - still there! =(:-O
(I am still on kernel 2.6.19 so maybe the above is no longer an issue)
Uhmm, - can anybody tell me please - what's going on here? - 'coz I haven't a clue!
the answer is here
But, Rubberman, the displayed digits are correct ! [as far as I can tell].
size of d is 4 bytes, the print-out is 39 digits.
I am new to C++ using GCC but the following program (print-out) gives very much more precision than the number of bytes allocated to a variable of (eg type float) 4 bytes ought to give and errno is always 0. Can anyone enlighten me as to why, please?
using namespace std;
#include <iostream>
#include <errno.h>
int main () {
cout.precision(9999);
float d=1; // 4bytes type - set i to 129 - result is 39 digits (:-o
// or try :-
//double d=1; // 8bytes type - set i to 1025 - 308 digits (:-O
// or try :-
//long double d=1; // 12bytes type - set i to 16385, - fails at i=16384 - 4932 digits? =(:-O
for (int i=1; i<129; i++) { d=d*2; cout<<"err="<<errno<<"\ti="<<i<<"\t"<<d<<"\n"; }
cout<<"\n"<< sizeof(d) <<" bytes is sizeof d\n\n";
return 0;}
The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.
Join / Linux Training / Board