Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to use preprocessor with c++11 but it's not work ?? #504

Open
Peken-bower opened this issue Nov 28, 2023 · 1 comment
Open

Trying to use preprocessor with c++11 but it's not work ?? #504

Peken-bower opened this issue Nov 28, 2023 · 1 comment

Comments

@Peken-bower
Copy link

#ifndef FIXED_HPP
# define FIXED_HPP
#include <iostream>
class Fixed {
private:
    int fixedPoint;
    static const int fractionalBits = 8;
public:
    Fixed() {
        fixedPoint = 0;
        std::cout << "the Constructor was called" << std::endl;
    }
    Fixed(const Fixed& value) {
        *this = value;
    }
    void setRaw(int fixedPoint_) {
        fixedPoint = fixedPoint_;
    }
    int getRaw(void) {
        return fixedPoint;
    }
};
#endif

the problem is

input_line_8:1:2: error: unterminated conditional directive
#ifndef FIXED_HPP
 ^
Interpreter Error: 
@carlosal1015
Copy link

@Peken-bower See this explanation.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants