strings defines möglichst einfach

Gast #2272459
Lesenswert?

Noch mal komplett:
1
#include <stdio.h>
2

3
#define _STR(s) _VAL(s)
4
#define _VAL(s) #s
5
 
6
#define VERSION_HB 3
7
#define VERSION_LB 0
8

9
#define VERSION_STRING _STR(VERSION_HB)"."_STR(VERSION_LB)
10

11
int main()
12
{
13
  puts(VERSION_STRING);
14

15
  return 0;
16
}
Bei mir steht da  3.0

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren