Skip to content

Tag: c++

BUILD_BUG_ON_ZERO not working in a simple user space application

I tried to use BUILD_BUG_ON_ZERO in a simple user space application and it is failed to compile Can anyone please provide me hints on the error. Answer The macro BUILD_BUG_ON_ZERO is intended to be used with a constant expression as defined in 6.6 constant expression. i isn’t a constant expression &#821…

strstr() and exit(0) trouble in C

so I’m working on a simulated linux shell using C (homework), and I have it exiting the program if the user just simply types in “quit”. However, if they throw “exit” somewhere inside a command… “cat file ; exit” I need it to execute the command like normal, the…