I define some values ββin the preprocessor. eg.
#define a 1000 #define b 0.5*a
When I try to use b in a place where an integer is required, I get an error. I donβt want to balways include it in my code and do it once per line #define, is this possible?
b
#define
Try the following:
#define a 1000 #define b (a/2)
#define b ((int)(a * 0.5))
Source: https://habr.com/ru/post/1755274/More articles:HTML, CSS: rounded corners do not have a transparent background in IE - htmlDisable dates older than today in the DatePicker plugin - jqueryWhy exactly is onFreeze () used? - functionDifference between UIView and UIControl when dragging inside UIScrollView - iphoneCompute a string as an object without eval () dynamically? - jsonHow to compile (create) a Qt application to work on many Linux distributions? - c ++What is the best way to store static data in an iOS app? - iphoneQt + XCompositeRender problem - linuxCase of excluding random pointers: a ternary conditional operator that does not work with string concatenation - javaIs it possible to request a custom workitem field in the TFS SDK - tfsAll Articles