Skip to main content
Code Review

Return to Answer

Commonmark migration
Source Link

#Details review

Details review

#Details review

Details review

Remove remnant of an abandoned train of thought
Source Link
Toby Speight
  • 87.9k
  • 14
  • 104
  • 325
class Grid
{
public:
 class cell;
 class const_cell;
 Grid(std::size_t width, std::size_t height);
 char operator()(int x, int y) const;
 void set(int x, int y, char value);
};
class Grid
{
public:
 class cell;
 class const_cell;
 Grid(std::size_t width, std::size_t height);
 char operator()(int x, int y) const;
 void set(int x, int y, char value);
};
class Grid
{
public:
 Grid(std::size_t width, std::size_t height);
 char operator()(int x, int y) const;
 void set(int x, int y, char value);
};
I don't normally see [windows] questions; this code is almost portable, so why constrain it so?
Source Link
Toby Speight
  • 87.9k
  • 14
  • 104
  • 325

Always check the return value of system(). Here, you're executing a program that doesn't exist on my system, so it just gives a whole lot of error output. If this is intended to clear the screen, consider using a Curses implementation (but be aware that it's still not going to be effective when output is going to a file, a printer or an Emacs buffer). As it's the only part of the code that's not portable C++, it's well worth considering another approach here.

Always check the return value of system(). Here, you're executing a program that doesn't exist on my system, so it just gives a whole lot of error output. If this is intended to clear the screen, consider using a Curses implementation (but be aware that it's still not going to be effective when output is going to a file, a printer or an Emacs buffer).

Always check the return value of system(). Here, you're executing a program that doesn't exist on my system, so it just gives a whole lot of error output. If this is intended to clear the screen, consider using a Curses implementation (but be aware that it's still not going to be effective when output is going to a file, a printer or an Emacs buffer). As it's the only part of the code that's not portable C++, it's well worth considering another approach here.

Source Link
Toby Speight
  • 87.9k
  • 14
  • 104
  • 325
Loading
lang-cpp

AltStyle によって変換されたページ (->オリジナル) /