Added program for telling you what C Standard your compiling against.

This commit is contained in:
ganome 2025-05-05 15:00:37 -06:00
parent f158e68c55
commit 2528097db4
Signed by untrusted user who does not match committer: Ganome
GPG Key ID: 944DE53336D81B83
2 changed files with 20 additions and 0 deletions

18
C/YT-BroCode/CSTD/cstd.c Normal file
View File

@ -0,0 +1,18 @@
#include <stdio.h>
int main(int argc, char** argv) {
// Check for C standard version
#if __STDC_VERSION__ >= 201710L
printf("We are using C18!\n");
#elif __STDC_VERSION__ >= 201112L
printf("We are using C11!\n");
#elif __STDC_VERSION__ >= 199901L
printf("We are using C99!\n");
#else
printf("We are using C89/C90!\n");
#endif
// Indicate successful execution
printf("C standard is: %ld\n\n", __STDC_VERSION__);
return 0;
}

View File

@ -11,6 +11,8 @@ int main() {
name[strlen(name)-1] = '\0'; // This removes the newline character at the end of 'name' variable
printf("\n\nHello %s!\n\n", name);
// strset(name, '?');
// printf("How are you %s?\n\n", name);
return 0;
}