Interested in advertising on Derpibooru? Click here for information!
Techy Cutie Pony Collection!

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

Description

I really like her main()!

safe2177513 artist:drewklettke4 sweetie belle56831 pony1605774 unicorn539367 g42033041 c (language)16 female1806199 filly97588 gritted teeth19466 heart eyes29882 i really like her mane76 looking at you259913 microsoft windows924 notepad++1 programming133 pun8950 simple background597945 smiling398400 solo1428612 vector89942 white background162519
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!”);  
}  
}