#Constants

11 messages · Page 1 of 1 (latest)

random hollow
#

Is there a way to use constans like this?

ionic scrollBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

#

@random hollow

Screenshots!

Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!

silk crater
#

Look into macros

#

;compile

#define TEMP 50
printf("%d\n", TEMP);
half spadeBOT
#
Program Output
50
silk crater
#

;asm -E

#define TEMP 50
printf("%d\n", TEMP);
half spadeBOT
#
Assembly Output
# 0 "/app/example.cpp"
# 1 "/app//"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "/app/example.cpp"

printf("%d\n", 50);

rare aurora
#

;compile ```c
#include <stdio.h>

#define TEMP 50

#define STR_(x) #x
#define STR(y) STR_(y)

int main(void) {
printf("foobar qux bob " STR(TEMP) "\n");
return 0;
}

half spadeBOT
#
Program Output
foobar qux bob 50
ionic scrollBOT
#

This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.