Jump to content

I'm learning C


runesmithie

Recommended Posts

Normally I wouldn't post something like this, but I feel a language like C deserves it :) I'm mostly posting this so I can get helpful pointers from everyone while I'm learning. Every once in a while I'll post some code I worked on to learn a specific concept and maybe a description of how it works if anyone would like to learn along with me.

 

 

 

Day 1:

 

 

 

Prints hello, world :)

 

http://www.eclipsor.com/code/ex1-1.c

 

 

 

Prints hello world and adds extra escape sequences to see what they do

 

http://www.eclipsor.com/code/ex1-2.c

 

 

 

Prints a Fahrenheit->Celsius table for Fahrenheit 0-300 in steps of 20

 

http://www.eclipsor.com/code/ex1-3.c

 

 

 

Same as above, but Celsius->Fahrenheit

 

http://www.eclipsor.com/code/ex1-4.c

 

 

 

Same as the Fahrenheit->Celsius table, but from Fahrenheit 300-0

 

http://www.eclipsor.com/code/ex1-5.c

 

 

 

Verifies that getchar() != EOF is either 0 or 1

 

http://www.eclipsor.com/code/ex1-6.c

 

 

 

Prints the value of EOF

 

http://www.eclipsor.com/code/ex1-7.c

 

 

 

Counts blanks, tabs, and newlines

 

http://www.eclipsor.com/code/ex1-8.c

 

 

 

Copies input to output, but replaces strings of spaces with just one (my personal favorite)

 

http://www.eclipsor.com/code/ex1-9.c

 

 

 

Reads input and replaces tabs with \t, backspaces with \b, and backslashes by \\ (currently I have no idea how to simulate a \b?) EDIT: ^H is a \b :D

 

http://www.eclipsor.com/code/ex1-10.c

smithie3.jpg

I just posted something! ^_^ to the terrorist...er... kirbybeam.
Link to comment
Share on other sites

  • 1 month later...

One of my current assignments is in C++ with OpenGL, needless to say we've been thrown in at the deep end with absolutely NO experience in C++ or OpenGL. Fortunately most of it just involved editing code though.

 

 

 

 

 

 

 

I've also found a utility which can translate .obj models into the C++ code for OpenGL so I can use them in my program, which is pretty cool.

 

 

 

 

 

 

 

[EDIT by jaklumen: The quote and reply here have been edited out.]

Some people are changed by being a moderator. I wouldn't be.

Link to comment
Share on other sites

I'm mostly posting this so I can get helpful pointers

 

 

 

 

 

 

 

*Ahahahahahh.

 

 

 

 

 

 

 

(prefix your variables with an asterik to signify it as a pointer)

summerpngwy6.jpg
Link to comment
Share on other sites

 

I'm mostly posting this so I can get helpful pointers

 

 

 

 

 

 

 

*Ahahahahahh.

 

 

 

 

 

 

 

(prefix your variables with an asterik to signify it as a pointer)

 

 

 

 

 

 

 

Lol.... wonder how many understood this. Such a terribly stupid joke lol....

...

Link to comment
Share on other sites

 

 

I'm mostly posting this so I can get helpful pointers

 

 

 

 

 

 

 

*Ahahahahahh.

 

 

 

 

 

 

 

(prefix your variables with an asterik to signify it as a pointer)

 

 

 

 

 

 

 

Lol.... wonder how many understood this. Such a terribly stupid joke lol....

 

 

 

 

 

 

 

Yeh, I added in the bracketed expression afterwards because I thought it too discrete.

summerpngwy6.jpg
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.