Wim
Or is it just that you're seeing the complete stupidity about it you're now turning?
Wim
I do vouch for good libraries though and using them
Wim
But they shouldn't require an extra 1G of memory EVER
Francisco
Or is it just that you're seeing the complete stupidity about it you're now turning?
You just calm down. If you want to use your own library instead of an already existing one, is your problem.You'll spend a heck lot of time coding it and the results won't be even near to the already existing ones. We don't have pip like Python does, and that's problem in package management, but you can start trying things like Conan.
Wim
Hold on there
Wim
We're talking about dumb fragments of a number
Wim
You're telling to include a whole library for something thats so easy it should be in a textbook
Wim
Not having pip or whatever is no excuse to that
Francisco
You're telling to include a whole library for something thats so easy it should be in a textbook
If it's easy, there's a lot of chances it's already in the STL
Wim
Precision outside IEEE specs pretty much falls out of any specification, so don't expect it to be in it as it tried to adhere to standards
Francisco
Precision outside IEEE specs pretty much falls out of any specification, so don't expect it to be in it as it tried to adhere to standards
If you don't like something about the standard or you feel like something is missing, make a proposal and wait for it to be accepted by the commitee in the next revision
Wim
How does that relate to the fact that IEEE encoding is not endless but for the extra precision you'd like to have you can simply write a few lines of extra code instead?
Wim
If you'd put half the effort in writing it as you did in trying to justify the "I don't have to think about it and just grab a library" as you did here, then its a few lines of extra code; if you want to find a good library it'll take hours or even days to make sure its fit for the job which you could've done already, multiple times by now
Farhan
Hello
Dima
do you even read the rules lol. it’s for unrelated discussions
Rekha
Why c language is platform dependent? And independent?
Rekha
What is assembly language?
Francisco
What is assembly language?
Look fot it in google
Rekha
But I don't understand
Wim
What is assembly language?
Its machine language written in mnemonics to make it understandable for humans
Rekha
Why character data type is under intergal category
Wim
Why character data type is under intergal category
Could you re-phrase that question?
MᏫᎻᎯᎷᎷᎬᎠ
What are the differences between std::string and std::string_view?!
Rekha
No
Rekha
Why character data type is under intergral category?
olli
What are the differences between std::string and std::string_view?!
std::string_view doesn't own the string, it's basically a pointer and a length.
Wim
Assembler only distincts between value-sizes, any character is just a value?
olli
Why character data type is under intergral category?
Because a char, int and long are all integral value (whole numbers)
Anonymous
My dear friends, Sorry to ask silly small question, Though I'm aware of some sites , Could anyone please suggest good C++ sites for learning.
Rekha
Thank you so much @Drazzy @BOND_0O7
olli
Thats C, not assembler?
True, I think he meant: "Why is char considered integral in the standard documents"
MᏫᎻᎯᎷᎷᎬᎠ
So There are no ways of copying?!
Then we can just use the std::move with std::string🤷🏻‍♂
Wim
Probably, Olli, I thought he was still going on about Assembler
olli
So There are no ways of copying?!
You can copy a string_view that has the same effect as copying a pointer (shallow copy)
Roberto
Hi guys! I was readin this code. I don't understand why there is a getline instruction before the while loop with se same getline as argument. Can you explain me?
Anonymous
My dear friends, Sorry to ask silly small question, Though I'm aware of some sites , Could anyone please suggest good C++ sites for learning.
MᏫᎻᎯᎷᎷᎬᎠ
You can copy a string_view that has the same effect as copying a pointer (shallow copy)
Lol Multiple objects has the same pointer I thought that was A bad practice, that's why std::shared_ptr exists!!!
Ибраги́м
https://www.reddit.com/r/cpp/comments/bsflbt/noone_knows_the_type_of_char_char/?utm_medium=android_app&utm_source=share
Ибраги́м
I give up
olli
Lol Multiple objects has the same pointer I thought that was A bad practice, that's why std::shared_ptr exists!!!
But the purpose of std::shared_ptr is different, since the smart pointers own the ressource. A string_view owns nothing. Imagine you are parsing some text and while parsing you need to pass a substring to some other functions. Either you copy the substring, or you just create a std::string_view which "limits the view" to the substring you want to have
Mihail
Probably, Olli, I thought he was still going on about Assembler
he was clearly just going on about his test questions lol
olli
So you mean getting the address of the substring
e.g. like this. #include <string> #include <string_view> #include <iostream> int main() { std::string foo{"Hello World"}; std::string_view first_word{foo.c_str(), 5}; std::string_view second_word{foo.c_str() + 6, 5}; std::cout << first_word << ' ' << second_word << '\n'; } first_word and second_word are only views into the foo string. In comparison to only pointes, string_view provides iterators, searching and so on
Rekha
Sorry
Rekha
@MissRose_bot
Mihail
that's a bot
Mihail
and don't do that again or you'll get banned
Rekha
Sorry I don't know how to use telegram that my first day. Please don't me banned.
MᏫᎻᎯᎷᎷᎬᎠ
Thaaanks
Mihail
Sorry I don't know how to use telegram that my first day. Please don't me banned.
below the group title there's a pinned message. click there and read the rules
Rekha
Why we need to Standardization in c programming language?
olli
Why we need to Standardization in c programming language?
We are no Q&A... You can read about standardization here https://en.wikipedia.org/wiki/Standardization
Saqib
👍
Daniele°
Saqib
#include <stdio.h> int var = 20; int main() { int var = var; printf("%d ", var); return 0; }
Saqib
Predict the output?
Saqib
Answer says: Garbage value
Saqib
The explanation given was "First var is declared, then value is assigned to it. As soon as var is declared as a local variable, it hides the global variable var."
Saqib
What does it mean here to hide the global variable var?
Saqib
how can it hide globall variable...?? also how can int var =var ; be valid statement means how can we assign var to var...?
Tushar
Within the body of a function, a local variable takes precedence over a global variable with the same name. If you declare a local variable or function parameter with the same name as a global variable, you effectively hide the global variable.
olli
how can it hide globall variable...?? also how can int var =var ; be valid statement means how can we assign var to var...?
Shadowing or Hiding works by declaring another variable with the same name in a local block (scope). e.g. int main() { int f = 1; { // the only f declared is the one set to 1 printf("%d\n, f); // shadow f in the current scope int f = 2; // f has been "shadowed" and set to 2 above printf("%d\n, f); } // the local f (only one exists) has been set to 1 printf("%d\n, f); } What's the output here? It's nothing special to C/C++ https://en.wikipedia.org/wiki/Variable_shadowing
Saqib
Oh okay so according to this the outputs will be 1
Saqib
then 2
Saqib
then 1
Saqib
Got it.
Saqib
Thanks
Tushar
Output is 1 only.