+ 2
Why's my code throwing an error?
12 Respuestas
+ 5
Remove & in all statements of vector definition, and declarations:
use only
std::vector<int> calc(int len,int width);
+ 5
Jayakrishna🇮🇳 but why's the & producing the error?
+ 5
Solomoni Railoa no, it's pass by value by default. Yeah I'll take a look at that👍
+ 5
Jayakrishna🇮🇳 Solomoni Railoa Ash
I've found the error! The error was because of returning a reference to a local variable from a function. I've fixed it as below and works good
https://code.sololearn.com/ctyTNeGC4hMx/?ref=app
+ 4
Pradeep Pogunulla only post related to the question in the answer section
+ 2
رادمهر مظفری
What?
0
https://discord.gg/kre5HQa7ea computer science stuff
- 3
Zor
- 3
بده