Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8403003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:13:42+00:00 2026-06-09T22:13:42+00:00

The format of define preprocessor directives are: #ifndef SIZE #define SIZE 10 int hello[SIZE];

  • 0

The format of define preprocessor directives are:

#ifndef  SIZE
#define SIZE 10
int hello[SIZE];
#endif

But when I look at the following code, there is no replacement for the preprocessor directives:

#ifndef CREDIT_CARD_H                    // Avoid repeated expansion
#define CREDIT_CARD_H

#include <string>                        // Provides string
#include <iostream>                      // Provides ostream

class CreditCard
{
    public:
        CreditCard(const std::string& no,    // Constructor
                   const std::string& nm, int lim, double bal = 0);

        // Accessor functions
        std::string    getNumber()const    { return number; }
        std::string    getName() const     { return name; }
        double         getBalance() const  { return balance; }
        int            getLimit() const    { return limit; }

        bool chargeIt(double price);       // Make a charge
        void makePayment(double payment);  // Make a payment

    private:                               // Private member data
        std::string    number;             // Credit card number
        std::string name;                  // Card owner's name
        int            limit;              // Credit limit
        double        balance;             // Credit card balance
};

std::ostream& operator<<(std::ostream& out, const CreditCard& c);
#endif

What does this mean?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T22:13:44+00:00Added an answer on June 9, 2026 at 10:13 pm

    You can say #define FOO, which means that #ifdef FOO will be true, but FOO doesn’t have any replacement text. This is useful precisely for conditional checks like the include guards.

    It can also be useful for platform-specific extensions, which you want to be empty in the general case:

    #ifdef WIN32
    #  define API __declspec(dllexport)
    #else
    #  define API
    #endif
    
    API void foo();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tried this: #define format(f, ...) \ int size = strlen(f) + (sizeof((int[]){__VA_ARGS__})/sizeof(int))
I was wondering if you can define Lists in a similar format to: List<int>
When I add the following to my code. // Define the input layout D3D10_INPUT_ELEMENT_DESC
I almost finishing a clean NSLog with this code: #define NSLog(FORMAT, ...) printf(%s\n, [[NSString
I have a config file with some information, in the following format: define(FTP_USERNAME,583hdsljf); define(FTP_PASSWORD,******);
What if I wanted to define a custom column format in MySQL? The custom
How to define key store in SoapUI it is giving error invalid keystore format.
how can i define NSTimeInterval to mm:ss format?
Intel makes microprocessor, so he could define the instruction format and its corresponse assembly
#include <boost/format.hpp> #include <boost/scoped_ptr.hpp> #include <stdexcept> #include <unordered_map> #include <functional> #define DECLARE_OBJECT(classname) namespace {core::declare_object<classname>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.