Developer
Can anyone please give me link of Microsoft visual C++ 14.0 with build tools
Jumjumi
please give an example array
Anonymous
hi
Lucky
Hey
Anonymous
https://stackoverflow.com/questions/21227568/2d-vector-with-3-columns-and-undeclared-number-of-rows
Anonymous
I want to declare a vector of vector with predefined no. of columns
Anonymous
but not rows But, it seems the declaration is a bit weird
Anonymous
std::vector<std::array<int, col_size>> is good but can I use just vector and not array?
Artöm
You can but array is preferred
Universal
Thanks.I am happy that I am in this group now
Anonymous
You can but array is preferred
How can it be done vector<vector<int, 20>> doesn't work and why is array preferred?
Anonymous
#include <stdio.h> int main() { int i=10; i = !i < 14; printf("%d",i); }
Anonymous
output= 1
Anonymous
Pavel
Why ?
implicit cast from bool to int
Pavel
i casted to bool is true (because 10 is not zero) so !i is false false is 0 0 < 14 is true true is 1
Pavel
as far as I understand it
Pavel
yes, fixed it
✨ Anatolii
Why don't work? void SprositiPolzovatela() { for(unsigned int i=1;i<5;i++) { cout << "OK? (y/n) "; cin >> c; // bolshie i malenkie bukvi c = tolower(c); if(c == 'y' || c == 'n') i=9000; else i--; }}
F
Thank you rose
Anonymous
Just resize inner vector
I know resizing a vector but how to resize the inner one ?
Artöm
Or in a loop to create rectangle matrix
Anonymous
mtx[idx].resize(new_size);
But, this I'll have to do for every index
Artöm
Yes
Artöm
With std::array you dont
Anonymous
How to make it by default of new_size
Anonymous
With std::array you dont
ok but then std::array doesn't support vector properties
Artöm
n x m matrix vector<vector<int>> mtx(n, std::vector<int>(m));
Artöm
ok but then std::array doesn't support vector properties
Like push_back? Of course, because it has constant size
Anonymous
Artöm
Replace n and m with desired values
Anonymous
No i mean not specifying n bcz I can add any no. of rows
Anonymous
just specifying m and leave n upto the programmer
Artöm
const vector<int> row(m); ... mtx.push_back(row);
Anonymous
I want both inner to be of type std::vector
Artöm
Check vector api already
Anonymous
const vector<int> row(m); ... mtx.push_back(row);
So, const mean that I can't resize?
Artöm
Yes
Pavel
just specifying m and leave n upto the programmer
Just make a class and incapsulate this logic in it
Artöm
Remove it if you want
Anonymous
Use push_back, its that simple
yeah it is. But, I was thinking of some other way that could be possible
Anonymous
BTW, thanx i will do it that way.
Artöm
Which vector api you want that array doesnt have?
Anonymous
hai
Artöm
/report referal shit
Artöm
hai
Be gone
Anonymous
sorry
Artöm
Read the rules first
Artöm
Are you here for C/C++?
Anonymous
yes bro
Anonymous
just know post in wrong group
Anonymous
Read the rules first
already read it
Anonymous
sorry everyone
Anonymous
I want tetorial in C language, I want to try it, do you know where to find it ?
Artöm
wandbox.org
Anonymous
Thanks ✨
rex
can anyone give me the logic to copy the file input in reverse order
rex
suppose text file contain one two these
rex
print it in like eno owt eseht
Artöm
print it in like eno owt eseht
Read line by line, reverse, write to new file. Or save in array and rewrite file
Artöm
/report referal shit
Artöm
Get your rupees other way
Virat Upadhyay
Miss forwarded
Virat Upadhyay
I apologize for this
Virat Upadhyay
😐
Artöm
Nvm, pay attention before send
klimi