olli
It's wrong if your iterator is named i :D
good luck enforcing this behavior in a shared code base :) but ofc. in 99.99% it won't matter
Alignant
That's, actually, why python has a great syntax. It doesn't have 3 ways to initialize a variable :D
olli
But that's also why i love C++, there are so many ways to do things. And there are barely general rules, like "it always depends"
Alignant
still, how would you solve this?
What's wrong with it? Backwards iteration is even faster
Alignant
At least with an int :D
olli
please write the head of the for loop with unsigned ints
klimi
Good night
Alignant
Because jz/jnz is a simple instruction
Alignant
please write the head of the for loop with unsigned ints
What do you mean? std::vector.size() returns a unsigned long long, aka size_type
olli
I am interessted in how your terminate - condition would look like
olli
Because using unsigned ints (ints as integral values, not int) you cannot check for i < 0
olli
While != 0 isn't okay? :D
So you would acces by x[i - 1] ? Of course it is
olli
Just curious :)
Alignant
It would be optimized to check if not zeru using jz/jnz
olli
but you would need to subtract for accessing each index
olli
Why, it can use dec :D
still an operattion that needs to be made
Alignant
So you would acces by x[i - 1] ? Of course it is
What does it matter? It should never be a negative in [ ]
Alignant
Actually, I use int over unsigned int. I'm just making a point that it's not a big deal if someone uses unsigned int :D
Anonymous
It even supports Go
is support for go from gccgo at good point?
数学の恋人
Hey everyone how can i cout the double datatype variable with precision, like 2.0 and similar. I asked this as i was getting just 2
BinaryByter
std::cout << std::fixed;
BinaryByter
Put that above the double you want to be printed
数学の恋人
Okay
BinaryByter
If it doesnt do what you want, google iomanip
数学の恋人
If it doesnt do what you want, google iomanip
I know I can do that but that challenge won't let me include iomanip
BinaryByter
std::fixed isnt in iomanip
数学の恋人
std::cout << std::fixed;
even after this problem still persists. I gave this line: cout<<result2<<std::fixed<<"\n";
BinaryByter
Use fixed before the variable you wanna print
数学の恋人
Use fixed before the variable you wanna print
I did this and now It's printing 8.000000
数学の恋人
I want just 8.0
数学の恋人
%.2f?
Sorry I didn't understand.
数学の恋人
%.2f?
What did you mean by this?
Bobby_ke
I did this and now It's printing 8.000000
You need to set the amount of decimals you want
Bobby_ke
std::cout << std::setprecision( );
Bobby_ke
std::cout << std::setprecision( 1 );
Bobby_ke
Ok!!!
数学の恋人
BTW thanks for reminding me
数学の恋人
But I think the correct syntax would be something like this: cout<<fixed<<setprecision(1)<<result2<<"\n";
数学の恋人
Is getline there in <iostream>
数学の恋人
I want to do, getline(cin, some_string); So should I include <string> also?
Bobby_ke
I think you should
Krens
Please suggest me the best material for learning c++ and c language
Krens
For beginners
Mat
You're just the 273728611 person asking this
Krens
Search in chat
There are to many chats in the group ....So I am confused
Mat
Really
Krens
Ok
Mat
Everytime someone arrives and ask the very same question
Kelvin
Ariana
Rokas Urbelis: ## Welcome We're very glad to welcome you to join the International C/C++ Group. You can invite others by https://t.me/programminginc ## Rules * 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 right after joining will get you BANNED. * Reverse enginnering, hacking (not facebook, instagram, etc.) 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 ok (no homework requests, or "pls write entire program for me" requests). * 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 will grant you a warning or an immediate ban if you spam right after joining. * Religion, politics and ideological topics are forbidden. ## 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/) ## Reports If you notice any forbidden content, please use the /report command while responding to the offending post to report it to the admins.
Can someone add the github link that has the c++ books
Marie
Notes in chat: - cpp - cppbook - goodcodingmentality - goodgoogling - googleit - hownottoask - ide - learn - meta - noendl - offtopic - ot - projects
Kelvin
#cppbook
Marie
#cppbook
https://t.me/programminginc/49901
Kelvin
#cpp
Marie
#cpp
https://t.me/programminginc/24103
Kelvin
Can someone add the github link that has the c++ books
https://github.com/EbookFoundation/free-programming-books/blob/master/free-programming-books.md
Kelvin
Some admin please save it.
Kelvin
??
Mat
/save freeprogrammingbooks https://github.com/EbookFoundation/free-programming-books/blob/master/free-programming-books.md
Marie
/save freeprogrammingbooks https://github.com/EbookFoundation/free-programming-books/blob/master/free-programming-books.md
Yas! Added freeprogrammingbooks. Get it with /get freeprogrammingbooks, or #freeprogrammingbooks
Mat
#freeprogrammingbooks
Marie
#freeprogrammingbooks
https://github.com/EbookFoundation/free-programming-books/blob/master/free-programming-books.md
Kelvin