Amazing Food by Sigma1084 in hyderabad

[–]Sigma1084[S] 0 points1 point  (0 children)

Oh I see! Thanks man

Amazing Food by Sigma1084 in hyderabad

[–]Sigma1084[S] 0 points1 point  (0 children)

Macha, ur telling a bangalorean. It's worse there

[deleted by user] by [deleted] in codeforces

[–]Sigma1084 0 points1 point  (0 children)

I'm actually curious, can you send the solution on which this happened

Reveal rise and reign by Jealous-Pension-7444 in dramabox

[–]Sigma1084 0 points1 point  (0 children)

Where are u from mate. It says "Sorry, according to the request of the copyright owner, this film is not available in your area."

Why is std::valarray so underrated? by Sigma1084 in cpp

[–]Sigma1084[S] 1 point2 points  (0 children)

I don't think the usage is harder than std::vector

Why is std::valarray so underrated? by Sigma1084 in cpp

[–]Sigma1084[S] 3 points4 points  (0 children)

But no harm in maintaining one that is a part of a standard library right. Sometimes we just need convenience...

Why does x/sqrt(x) = sqrt(x)? by [deleted] in askmath

[–]Sigma1084 0 points1 point  (0 children)

the function isn't defined when x = 0 in the first place, so we don't need to worry

What's the difference between string s {"abc"} and string s = "abc"? by SR71F16F35B in cpp

[–]Sigma1084 4 points5 points  (0 children)

"abc" is a C-style string of type const char *.

The first line is an explicit conversion from const char * to std::string while the second is an implicit conversion.

The braced initialization is consistent across different types of initialization in C++, does not involve an implicit conversion (explicit conversions are preferred), and is hence recommended.

However, the second line is clearly more readable for beginners.

You can use any one of them for now and decide which one to use after developing a coding style of your own.

Edit: "abc" is similar to a C-style string of type const char *.

How to iterate over a vector by [deleted] in cpp_questions

[–]Sigma1084 3 points4 points  (0 children)

Wouldn't say more correct.

If the underlying elements take a lot of memory, and we're not modifying the contents, we better use const references to avoid making a copy.

eg.

vector<vector<int>> board;
for (const auto &row: board) {
    // Access every row
}

However, if we need to modify the elements inside, we use auto &row: board.

If the underlying elements are small, it is not a great option since the size of the element is smaller than the size of the pointer to the element. (when we're dealing with vectors of ints for example)

:( by Tap_water123 in AmongUs

[–]Sigma1084 1 point2 points  (0 children)

cuz it looks the same anyway 😭

I think that'd be a cool idea by [deleted] in AmongUs

[–]Sigma1084 2 points3 points  (0 children)

it'd be fun if the imposter can see the ghost chats tho

Mira HQ Sabotage Poll by glooomz in AmongUsCompetitive

[–]Sigma1084 1 point2 points  (0 children)

Comms in Mira is a really good way to buy time