Interested in advertising on Derpibooru? Click here for information!
Sky Railroad Merch Shop!

Help fund the $15 daily operational cost of Derpibooru - support us financially!

Description

I really like her main()!

safe2266539 artist:drewklettke4 sweetie belle58639 pony1698898 unicorn581075 g42126120 c (language)17 female1907863 filly104884 gritted teeth20652 heart eyes32160 i really like her mane80 looking at you282630 microsoft windows954 notepad++1 programming141 pun9161 simple background638282 smiling431346 solo1504786 vector92638 white background177062
Source

Comments

Syntax quick reference: **bold** *italic* ||hide text|| `code` __underline__ ~~strike~~ ^sup^ %sub%

Detailed syntax guide

HeartLinda

The parameter list should be (void), not (), since an empty parameter list means unspecified parameters, not no parameters (unlike in C____).
 
@K_A
 
In this case, there can’t be any precedence issue, because they’re simple constants.
Background Pony #0439
Defining functions without a return type is discouraged and deprecated in recent versions of C. The entry point should always be defined to return int, and produce a value of 0 upon successful execution, or a non-zero value on error.
 
@K_A
 
Ideally, you should just  
# include <stdbool.h>
 
This not only defines constants for true and false, but also defines a bool type, and is available even in freestanding environments.
K_A
Bronze Bit -
Diamond -
Happy Derpy! -
Bronze Supporter -
A Perfectly Normal Pony - <K_A> Once you go eenahp, you can't go beenahp.
The End wasn't The End - Found a new home after the great exodus of 2012

@K_A
 
Make that:  
#define TRUE (1)  
#define FALSE (0)
 
I forgot to use parentheses to prevent operator precedence issues (subtle technical aspect of the C preprocessor from how macros do blind substitutions).
K_A
Bronze Bit -
Diamond -
Happy Derpy! -
Bronze Supporter -
A Perfectly Normal Pony - <K_A> Once you go eenahp, you can't go beenahp.
The End wasn't The End - Found a new home after the great exodus of 2012

@A Sad Pony
 
It is. Any non-zero value is interpreted as true in conditional branching (as is well reflected in the underlying processor instructions for branch-if-zero and branch-if-not-zero), and by convention the number 1 is used to represent truth as per common Boolean notation. You can also define via macros under the includes the integer values of TRUE and FALSE to prevent “magic numbers,” though the 0/1 convention is imminently familiar with C programmers.
 
#define TRUE 1  
#define FALSE 0
A Sad Pony
Artist -
The End wasn't The End - Found a new home after the great exodus of 2012

I made a .gif once
@K_A
 
I was actually wondering if the while(1) thing was a thing in C after he posted that. I know you can do something similar in Python with a while True:.
K_A
Bronze Bit -
Diamond -
Happy Derpy! -
Bronze Supporter -
A Perfectly Normal Pony - <K_A> Once you go eenahp, you can't go beenahp.
The End wasn't The End - Found a new home after the great exodus of 2012

You can also just say while(1) and would probably want a newline \n at the end of the string. Furthermore, since no string formatting is actually done, you can also use the puts function which appends the newline character for you.
ze
The End wasn't The End - Found a new home after the great exodus of 2012

NO, NO, NO.
 
It’s:  
#include <stdio.h>  
main()  
{  
while(1=1)  
{  
printf(“Sweetie Bell is the best Cutie Mark Crusader!”);  
}  
}