Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include
using namespace std; class Computer{ private: string manufacturer; int ram; double cpu; public: Computer(string manufacturer = "", int ram = 0, double cpu = 0.0) { this->manufacturer = manufacturer; this->ram = ram; this->cpu = cpu; } }; class PCStore { private: Computer *computers; int n; int sz; public: PCStore() { computers = new Computer[10]; n = 0; sz = 10; } void add_computer(Computer c) { if(n == sz) { Computer *copy_array = new Computer[sz]; for(int i = 0; i < n; i++) { copy_array[i] = computers[i]; } sz *= 2; computers = new Computer[sz]; for(int i = 0; i < n; i++) { computers[i] = copy_array[i]; } } computers[n] = c; n++; } }; int main() { return 0; }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)