Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

Learn C!

Name: Anonymous 2005-02-19 5:56

For people who want to learn the C programming language I have two great sources for you
http://www.cs.cf.ac.uk/Dave/C/CE.html A book called C Programming printed in the 80's or 70's forget when.
http://www.cs.cf.ac.uk/Dave/C/CE.html This is one of the learn C sites but better.
All I can suggest is to pull long hours of the night, write the notes down in a note book and do the exercies. Learning on your own can be hard but you get use to it and you learn better this way. If you have any questions though try searching the internet to find the answers. Here is a example of a program I worte useing the C programming book. I have not learn all of the C language though..
#include <stdio.h>
#include <math.h>
//Evaluating Trigonometric Functions
int main(int argc, char *argv[])
{
  int x,y,output;
  float r;
  printf("Type in the X and Y points\n");
  scanf("%d,%d", &x, &y);
  r = sqrt((x*x) + (y*y));
  printf("The Sqareroot Equals: %.2f\n", r);
  printf("----------------------------\n");
  printf("sin = %d/%.2f\n", y, r);
  printf("cos = %d/%.2f\n", x, r);
  printf("tan = %d/%d\n", y, x);
  printf("csc = %.2f/%d\n", r, y);
  printf("sec = %.2f/%d\n", r, x);
  printf("cos = %d/%d\n", x, y);
  return 0;
}

Name: Anonymous 2005-02-19 5:57

Made a mistake. Here is the amazon link to the c programming book: http//www.amazon.com/...

Name: Anonymous 2005-02-19 9:05

>>1
I'll add a very important piece of advice to those who want to learn any programming language: write programs! You can't learn unless you experience by yourself. If you don't write and execute programs while you read a book, it won't lead you nowhere.

Write a program, compile it, execute it, debug it, compile the cleaned version, execute it, debug again...

Name: Anonymous 2005-02-21 23:29

thanks for the links!
i originally took the learning from books at the library, but now i can do it all on the internet! thanks anonymous.

Name: Anonymous 2006-02-10 16:54 (sage)

[c]c[/c]
codem

omae monaa~

Name: Iori Branford 2006-02-21 4:51

http://www.vijaymukhi.com/online.html

Interesting and funny online tutorials recommended by Ken Silverman. Beware, some of the later parts of the DOS tutorial, like writing directly to the screen, no longer apply today, and require a compiler that knows how to compile for DOS.

Name: Anonymous 2006-02-22 1:57

All you need to learn C is K&R, maybe with a glance at Wikipedia for the changes in C99.

Name: Anonymous 2006-02-22 7:45

>>7

Name: Anonymous 2006-02-22 15:42 (sage)

>>6
Thanks for the aging.

Name: Anonymous 2006-02-23 16:24

>>7

That's pretty much all you really need to read if you want to program in C at all. If you want to know how to do like, networking, there are books about that as well.

Name: Anonymous 2006-02-23 19:16

Want to write a book that sells forever? Write about a never dying language.

I have the exact same book bought 15 years ago.

Name: Anonymous 2006-02-24 10:27

>>11

COBOL!

Name: Anonymous 2006-02-26 3:17

>>1
Yeah, I'm noticing that you are giving usefull advice, which is a mistake here.  You should only come to this forum to say something like, "c is so shitty just like java! bloat! shit! slow! shitty mcshittpants with a shit-o-matic shitting machine on the shittiest day of the year."

Name: Anonymous 2006-03-03 19:07

>>13

just leave

Name: Anonymous 2006-03-03 20:35

>>14
gtfo my 4chan, noob

Name: Anonymous 2006-03-28 5:27

>>13
Hah, that is exactly what it used to be like in the demo scene about ten years ago. Amiga and C64 people dissing PC demos like "I bet it's made on a fukin C compiler, fkn bloated crap". And sure enough there weren't many C entries in the 4k intro competitions... but who writes entire applications in assembler any more?

Name: Anonymous 2006-03-28 5:28 (sage)

Oh and kiddies, if I see you declaring main as returning void or taking anything but void OR int,const char** I'm going to slap you so hard that Alan Turing is going to feel it and get an erection (the BSDM feller that he was).

Name: Anonymous 2006-03-28 5:59

>>16
I do (I told you I was hardcore)

Name: Anonymous 2006-03-28 6:27

>>17
I declare my main as:
long double *main(char ***x, float y);

Name: Anonymous 2006-03-28 6:56

>>19
That hurt me right in the geek.

Name: Anonymous 2006-03-28 12:44

I hope one days stuff is fast enough to run Python or other scripting languages for everything.

Name: Anonymous 2006-03-28 17:06

>>21
roffle

By the time that happens (it won't), the current batch of languages are all going to be outdated. Doesn't the fact that we're going multicore right now give a clue?

Name: Anonymous 2006-03-29 3:03

>>22
Yes, and scripting languages often support threading and more advanced features which could be adapted to support SMP with relative ease, such as fibers or generators; features which are not usually found in stricter languages.

Name: Anonymous 2006-03-29 4:19

>>23
The key word here is "relative".

If you want to see what the next generation of languages will probably look like, take a look at things like Occam and Erlang. Unlike current Python, Ruby, Perl, etc, these things take care of the parallelism in the language itself.

We're going to need languages that make developing on large numbers of cores easy, because it looks like that's where hardware is heading. It's a cheap way to keep hardware development and production costs sane while increasing through-put.

Now, parallelizing the algorithms... there be a whole new set of problems!

Name: Anonymous 2006-03-29 4:22

Why not let the OS handle distributing threads across cores?

Name: Anonymous 2006-03-29 4:31

>>25
Agree. As I said I would just modify Python and others like e.g. have generators behave like threads which are ready for the next item(s), and keep the current computing model.

And judging by the way things have gone in the past, I highly doubt multicore processors will produce a major change in programming languages or OSes. People will still use Java, and banks will still use COBOL.

Name: Anonymous 2006-03-29 5:04

>>25
The language first has to create the threads in the first place.

>>26
We'll see what happens. If the current batch of scripting languages mutate to support threading within the language itself, they could continue to thrive. Of course, the question is if they can do so nicely. If not, other languages will take their place.

I highly doubt multicore processors will produce a major change in programming languages or OSes.

That really depends on what you're doing (and on timescale). In anything that requires performance and scalability, they're already suffering. Debugging threads is no fun.

Again, take a look at Erlang. Python will never have that sort of scalability. If one day it does, the only thing it'll share with current Python is the name.

Name: Anonymous 2006-03-29 5:21

Debugging threads is a pain in the ass, but generators aren't. If you change the way you code to make it more stream-ey, concentrating on single units of information and using generators rather than loops, and avoiding global data, and manage to successfully implement generators using threads in the language, you can count it a new programming paradigm, one that benefits greatly from parallelism and yet it's very easy to debug and code.

I'm particularly fond of generators, the more I think about them, the more useful and nice they seem. I used something similar (fibers, or voluntary threads) a long time ago in a surprisingly good Spanish game programming language (DIV) and its modern C version (CDIV), based on a different programming paradigm where everything has to be a fiber and syncs to a multiple of the screen refresh rate. It was a pretty good experience.

Name: Anonymous 2006-03-29 7:56

Using generators rather than loops? Or do you mean wrapping loops within generators?

One problem with the current implementation of generators is that they're not asynchronous: once you call yield, it stops until the next call. Likewise, the caller cannot simply poll if a message is there or not.

It's doable, but I suspect there'd need to be a number of other changes. Just binding threads to generators won't work.

you can count it a new programming paradigm

Not really. What you've listed sounds similar to a functional language. Just like Erlang (how about that!).

Name: Anonymous 2006-03-29 7:58

Whoops. There's also the 1:1 communication issue. What about 1:N, or N:M?

Name: Anonymous 2006-03-29 12:51

>>29
Using generators rather than loops?
I really messed that up. I meant looping generators so that you fetch processed data as you need it and they may be run in a separate thread (if the generator is run in a thread, as I suggested). This shouldn't have side effects provided you don't write to global variables in the generator (which you rarely need), so it would be a very comfortable way to use multithreading.

I would add a keyword in the generator function definition to tell the interpreter it doesn't have side effects, which means it's safe to cache ahead. Another interpreter thread should be caching the results of the generator according to available CPU time and memory (or just a number of steps ahead for a simpler implementation). The way you program your generator wouldn't need to change one bit provided it doesn't have side effects like doing something else when it's called you want to be done at the right moment, or writing global data.

Name: Anonymous 2007-06-22 15:46 ID:bGcrxFtE

pickadick

Name: Anonymous 2007-06-22 16:43 ID:o8u94rqj

Why the bloody hell hasn't been SICP been mentioned yet?

Name: Anonymous 2007-06-22 17:17 ID:S6GufXFU

If you want to use C, follow this procedure:

1. Read SICP
2. Implement Scheme dialect in C
3. Use Scheme dialect instead of C

Name: Anonymous 2007-06-22 19:46 ID:uQTfGQ2j

>>6
That better be satire. I haven't seen anything quite as bad as that before.

Name: Anonymous 2007-06-22 21:45 ID:Heaven

>>33
because this thread is years old, stop replying to it

Name: Anonymous 2007-06-23 2:30 ID:seyB/wfc

>>36
yeah, OH GOD dopnt post in old threads?!

Name: Anonymous 2008-02-05 7:55

Wow, /prog/ was so much nicer back in the days.

Name: Anonymous 2008-02-05 7:57

>>38
Shut up and read your damn SICP, cuntface.

Name: Anonymous 2008-02-05 8:05

Wow, /prog/ used to be worse than /pr/.

Name: Anonymous 2008-02-05 9:37

>>33
I remember posting this.

Name: Anonymous 2008-02-05 16:08

>>41
I remember posting this.

Name: Anonymous 2008-02-06 19:29

>>42
I remember posting this.

Name: Anonymous 2010-12-06 21:29

[sup][#]\\[/#][/sup]Car whore//

Name: Anonymous 2011-01-31 22:31

bamping

Name: Anonymous 2011-01-31 23:23

[tt]tt[/tt]

Name: Anonymous 2011-02-01 14:03

>>28
Haha, wow, glad Im not the only one who learned DIV.
It was part of a "Game creation starter Kit" or something like that.
My "games" had the nasty habit to get very slow over time.
Did not even know that they added multicore stuff to the language.

Name: Anonymous 2011-02-03 2:23

Name: tray 2012-03-16 16:20

flagStuff|=1;

Name: Anonymous 2013-03-06 3:18

Learn C!

Name: Anonymous 2013-03-06 3:49

what for

Don't change these.
Name: Email:
Entire Thread Thread List