I just want to ask if there's a site where I can download Savings.h header file, I just need it for my sample program, my Borland 5.5 dont have it and even Dev-C++.
Thanks!

Dani AI

Generated

likely ran into a nonstandard header: Savings.h is almost always a user-created file from a textbook or class sample, not part of any compiler distribution. 's point about a header needing matching implementation is important: a header only declares an interface; the program needs the corresponding .cpp (or header-only definitions) to link and run. 's remark about homework is consistent with how these names are used in exercises.

A minimal, portable header (C++98 style) typically contains only declarations and include guards. Example skeleton:

#ifndef SAVINGS_H
#define SAVINGS_H

class Savings
{
private:
    double balance;
    double interestRate; // annual, as fraction

public:
    Savings(double initialBalance, double rate);
    void deposit(double amount);
    bool withdraw(double amount);
    void applyInterest(); // apply interest for one period
    double getBalance() const;
};

#endif // SAVINGS_H

Implementation goes in Savings.cpp (definitions for the constructor and methods). Common problems to watch for: linker errors when Savings.cpp is not compiled/linked; mismatched function signatures between header and implementation; use of C++11 features on very old compilers (Borland 5.5 predates C++11). Prefer creating the small header/implementation pair locally, or retrieve a full sample (header plus implementation) from a trusted course repository or version-control host and verify its license and compiler compatibility before use.

Recommended Answers

All 2 Replies

Nowhere. Without the code that is needed to run the functions in the header, the header alone is useless. And even if you did find the code, it probably can't be plugged into your compiler.

sounds like a header the kid needs to write for its homework assignment for its "bank account program".

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.