1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <assert.h>


int main(int argc, char* argv[]) {
    printf("String constant that contains a lot of "
        "text causing it to wrap around and I don't "
        "like that this line of text is 1 line in "
        "vim but 3 when displayed\n");
    // this trick only works with double quote
    // string constants, otherwise compiler error
    //const char* str = "Hello";
    //printf(str " World\n");
    
    printf("__FILE__ expands to " __FILE__ "\n");
    // __LINE__ is an integer, so we cannot use
    // the string concat trick
    printf("__LINE__ expands to %d\n", __LINE__);
    printf("__LINE__ expands to %d\n", __LINE__);
    printf("__LINE__ expands to %d\n", __LINE__);
    printf("__LINE__ expands to %d\n", __LINE__);
    printf("__LINE__ expands to %d\n", __LINE__);
    printf("__DATE__ expands to " __DATE__ "\n");
    printf("__TIME__ expands to " __TIME__ "\n");

    return EXIT_SUCCESS;
}
/* vim: set tabstop=4 shiftwidth=4 fileencoding=utf-8 noexpandtab: */

© Copyright 2024 Alexander J. Quinn & David Burnett         This content is protected and may not be shared, uploaded, or distributed.