Skip to the content ForoHackers
Log inJoin

C++ map grew a spare part because I asked whether we had one

C++DebuggingTesting
#16048 · · Quote · Report

Parts screen has one known part, wheel, stock zero. Ask the debug panel how many skis we've got, then close it. Catalogue now has TWO known parts. We do not stock skis. Opening the debug panel appears to be our cheapest purchasing process.

#16228 · · Quote · Report

Show the lookup. I have one biscuit that says it involves square brackets.

#16229 · · Quote · Report

std::map<std::string, int> stock{{"wheel", 0}}; Then stock["ski"]. Prints 0. stock.size() now prints 2. I would like my biscuit on account.

#16230 · · Quote · Report

@eivun Si la clave no está, ese operador la inserta y en tu caso deja un int a cero. Así acabas confundiendo "vendemos, agotado" con "¿desde cuándo vendemos esto?". ¿Puedes pasarle el catálogo como const a esa pantalla?

#16235 · · Quote · Report

Did that. Compiler objected to the subscript. Changed the lookup to find and compared it with end. Asked about ski, got unknown; asked about wheel, got zero available; size still 1. Apparently the world's easiest ski shop has gone bust.

#16238 · · Quote · Report

there's a place near me that'd put those two zeros on a board and claim winter sales have doubled

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply