Skip to content

Melmonster13/WeaponsChestApp

Repository files navigation

Integers Pointer Program in C++

This is a simple, fun, and secure console application in C++ that requests input from the user for three different weapons found in a magical weapons chest in an RPG-type of scenario. The user inputs are for the following: Flaming Sword (fire), Snooze Bow (sedative), Felling Axe (destruction). The program utilizes dynamic memory allocation and input validation.

Notable Features/Weapons

  • Secure dynamic memory management using 'new' and 'delete'

  • Avoid buffer overflows with validated integer input

  • Validates input stream using 'std::cin.fail()'

  • Handles memory allocation failure with 'try/catch' and 'std::bad_alloc'

  • Pointers are set to 'nullptr' after deletion to prevent dangling references

  • Flaming Sword: Accepts a fire damage value

  • Snooze Bow: Accepts a sedative strength value

  • Felling Axe: Accepts a destruction force value

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages