jupyter-xeus / xeus-cling

Jupyter kernel for the C++ programming language
BSD 3-Clause "New" or "Revised" License
3.01k stars 294 forks source link

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

Open Peken-bower opened 7 months ago

Peken-bower commented 7 months ago
#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 commented 6 months ago

@Peken-bower See this explanation.

image