Wrote my first C program. Feels great

Wrote my first C program. Feels great.

#include

int main()
{
EOF != 300;

printf("EOF");

return 0;
}
3 days so far in learning C. I'm open for advice too.

Attached: 1505276453821.jpg (509x625, 31K)

>EOF != 300;
This statement literally does nothing.

use code tags please

good job young padawan

i like imagining the compiler just going "k" and moving on

I know EOF stands for "end of file" but what I was trying to do was print the value of EOF, but how do I print the value if the precedence of EOF is not even higher than 300. I think I confused this with assigning statements

>I was trying to do was print the value of EOF
all you have to do is printf("%d\n", EOF);

oh god

I believe the correction would be
#include

int main()
{
EOF = 300; /* assigning value of 300 */

printf("EOF");

return 0;
}

If you are above 13 years of age you should give up now and learn python if you want to "code"

what you did was say EOF does not equal 300, which is always true because you did not assign it anything, see . do this to get what u want

Thanks man. I see my mistake. So when using "%d\n" I'm printing the values of the integers rather than assigning it a value.

You should do the exercises in the book instead of whatever the hell this is supposed to be. This is like trying to learn to drive a car and practicing by making a sandwich on the radiator.

the %d %4.2f and stuff are for formatted stings which are generally passed into standard library functions that have an f in the name, like printf(print format)
assignment is far simpler and is just a variable name followed by a = and then some expression

one of the exercises in KnR is to print the value of EOF iirc
but it was definitely not the first exercise

I want to become a great programmer not just "code" as a means to get gratification. Age doesn't matter, I believe I can learn to program.

Huh, you're right, it's 1.7.

Here's your (You)

>
>i like imagining the compiler just going "k" and moving on
Literally. It is compiled out by the compiler.

>#include
>int main()
>{
Absolutely halal. next time use this
int main(){
...
...
}

You mean haram?

I'm proud of you user!

plox program my bank account to not be empty?
Son?

Attached: 1547711564206.jpg (220x182, 6K)

kode*

>I want to become a great programmer not just "code" as a means to get gratification.
maybe you should start learning the basics

Attached: SICP_cover.jpg (400x579, 50K)

int main(void){

fuck off with your non-compliant main