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

Pages: 1-4041-

Diving into C

Name: Edward 2005-06-10 3:11

Hello people.

Quick question for you pedagogues out there...

I'm planning on learning some C as an introductory language, having done just a bit of basic and html in my youth, and having knowledge of algorithms from mathematics.

Does anyone have any pointers to some good books or sites for C (books preferred)?
By "good" I mean neophyte-friendly and easy to read.

Name: Anonymous 2005-06-10 3:18

You'll have lots of "pointers" :)

C is a pretty neat language, and it's what you end up using whenever you want to do anything really serious, especially system-related. Good choice.

I'd Google for C tuturials; you can choose five or so, then start in random order, do it for the first 10 minutes, and move on to the next one if you don't like what you see. It's usually the best way, I think.

Name: Anonymous 2005-06-10 3:29

you would be well advised to learn something more high-level first

Name: Anonymous 2005-06-10 6:33

You already know some Basic, right?

If you still don't feel comfortable with low-level stuff such as pointers, try Pascal, you'll like it (it's like Basic but more sorted of, with a more regular syntax that sucks less, and still strongly typed and all). Don't listen to the Java trend, never start with an OO language, much less Java, or you'll go crazy.

Name: Edward 2005-06-10 9:38

Well the deal is I'm a philosophy and physics student who is more of a specialist in philosophy of mind, cognition& epistemology, and Logic & semantic analysis. One of my friends thinks I'd do pretty well in a her Nat. Lang. Processing group. Although this isn't exactly my field it's a nice option to keep open.

Anyway, thing is I need a bit more mastery of the whole programming logic mindset. She told me to take a good look at C over the summer, as that would develop the sturdy reflexes I might need. So yeah, I'm staying well away from the complexity of OO stuff.

I've found an O'Reilley book. Might buy it, they're pretty good writers.

Name: Christy McJesus !DcbLlAZi7U 2005-06-10 10:35

I malrecommend C as a first language, unless you actually want to get down to the system level. If you want to do high level programming, learn a high level programming language. Also Pascal can bite me - oh wait, no it can't even do that.

Name: Anonymous 2005-06-10 19:55

>>6
Pascal is bitchy and you can't do much with it, but I think it's good to learn programming because it's strongly structured and typed, and I think it'll adapt best to Edward's profile.

Refer to this for more information:
http://www.indianz.com/board/topic.asp?TOPIC_ID=10016

Name: Anonymous 2005-06-11 3:14

it's true what >>6 says (gasp). with your background I'd recommend any of the following: scheme, haskell, ml, ocaml, c-lisp or python, and in that order too.

If you're set on C then pretty much any book will do (ultimately, all intro-level books say the same things), but it's not going to be an easy or rewarding experience.

Name: Christy McJesus !DcbLlAZi7U 2005-06-11 10:19

>> scheme, haskell, ml, ocaml, c-lisp or python

Yeah pretty much.

Name: Anonymous 2005-06-11 11:54

>>1
>Programming in C
http://www.scit.wlv.ac.uk/cbook/

>LEARN C/C++ TODAY (A list of resources/tutorials)
http://www.faqs.org/faqs/C-faq/learn-c-cpp-today/

C++ tutorials: http://www.cprogramming.com/tutorial.html

Don't like any of those? http://www.google.com/search?q=c+tutorial

Name: Anonymous 2005-06-11 12:28

The C Programming Language
by Brian W. Kernighan and Dennis M. Ritchie
is THE C book.

Name: Anonymous 2005-06-12 18:48

'The C Programming Language'
Rather expensive to find a copy of and isn't mean't to teach you the language. Serves primarily as a reference.

Name: Anonymous 2005-06-12 20:35

I went and learnt C with it. I don't know if it's the best way to learn though. It probably is, but only if you already know other languages.

Name: Anonymous 2005-06-13 7:47

>>11
I agree with >>12, I learned C by writing my own stuff and the best book I've read is a french book called "The C language" by Claude Delannoy, IMHO it's better than the K&R and goes deeper in what the language can do.

Name: abez !XWEgiX8ArQ 2005-06-20 21:57

I'm not going to recommend a book, I'm going to recommend you find a peice of open source software you enjoy using that is relatively simple and I recommend you read that software. In the software industry we don't get to read other people's code alot, writers learn from each other by reading each other's work. Until recently this has not been possible for programmers, but now you can, so I suggest you take advantage of open source software by reading some of the code out there.

Name: Anonymous 2005-06-22 0:50

I'm running NetBSD; I have the entire 2.0 source tree; but I can't make heads or tails out of anything I'm reading.

Is there anything online that I can read that fills the gap between using basic C statements and reading production-quality code?

Name: Christy McJesus !DcbLlAZi7U 2005-06-22 4:14

Apparently the OpenSolaris team are giving online guided tours of their source code. I might have a look at that, because I have difficulty reading other people's C code too, C not being my first language.

Name: Anonymous 2005-06-22 13:50

>>17 are you talking about their source code browser? Because I'm pretty sure there's one for linux and also one for some sort of bsd too.

Also, if you snoop around tuhs.org you'll find a page that lets you browse ancient unix (7th ed?) source code too.

Name: Edward 2005-06-22 18:39

>>6
>>7

Yah, I dig that. But the difficulty and especially the rigor needed to understand and work with C based languages is supposed to be a great foundation for the the sort of thinking you have to do in computer science. I personally would rather stick to my perl book, but apparently I'd develop too many bad knacks, given perl is pretty lax.

>>everyone Cheers for the links, or the 'pointers'. Hehe.

Name: Christy McJesus !DcbLlAZi7U 2005-06-23 9:48

>>18

I guess I am. I just remember seeing an article about "guided tours", but when I got to their site all there was was a source code browser. Hell I'd rather just download it and use vim.

Name: Anonymous 2005-06-26 22:37

Okay technical question. I I have:

    char a[5][5];
    char b[5][5];

How do I swap these two arrays so that `a` points to the data in `b` and vice versa?

Name: Anonymous 2005-06-26 22:37

Okay technical question. If I have:

    char a[5][5];
    char b[5][5];

How do I swap these two arrays so that `a` points to the data in `b` and vice versa?

Name: Anonymous 2005-06-26 23:24

>>21 I'm sure I"m wrong; but i would come up with a third array (c) and swap the contents of b into it using a for loop, then swap the contents of a into b in a second loop, then finally use a third loop to swap the contents of c into a.

Again, I'm a noob and I'm sure there's a much more efficent way of doing this; but that's how *I* would do it (knowing what I know now).

Name: Anonymous 2005-06-27 2:13

Too much work. They're just pointers:

char *p = a;
a = b;
b = p;

Name: Anonymous 2005-06-27 20:52

>>24
foo.c:7: warning: initialization from incompatible pointer type
foo.c:8: error: incompatible types in assignment
foo.c:9: error: incompatible types in assignment

Name: Anonymous 2005-06-27 21:18

>>25
I may be wrong but it may have to be

char **pp = a;
a = b;
b = pp;

Name: 24 2005-06-28 0:25

Sorry, I was mistaken. a and b are constants pointing to the stack, so >>23 was in fact correct.

For large arrays it might be easier and faster to allocate memory and swap the pointers instead.

Name: Anonymous 2007-09-02 14:55 ID:Heaven

lol

Name: Anonymous 2009-01-15 7:33

lol

Name: Anonymous 2009-01-15 8:14

>>5
Tell us more about this female. Have you had sex with her?

Name: Anonymous 2009-01-15 15:02

>>21-30
a^=b;
b^=a;
a^=b;

>>26 should work too

Name: Anonymous 2009-01-15 15:10

>>31
foo.c:7: error: incompatible types in assignment
foo.c:8: error: incompatible types in assignment
foo.c:9: error: incompatible types in assignment

Name: Anonymous 2009-01-15 15:14

>>31
foo.c:5: error: invalid operands to binary ^
foo.c:6: error: invalid operands to binary ^
foo.c:7: error: invalid operands to binary ^

Name: Anonymous 2009-01-15 19:12

>>32
a^=(char)b;
b^=(char)a;
a^=(char)b;

Name: Anonymous 2009-01-15 19:18

>>32
foo.c:5: warning: cast from pointer to integer of different size
foo.c:5: error: invalid operands to binary ^
foo.c:6: warning: cast from pointer to integer of different size
foo.c:6: error: invalid operands to binary ^
foo.c:7: warning: cast from pointer to integer of different size
foo.c:7: error: invalid operands to binary ^

Name: Anonymous 2009-01-16 3:33

t = malloc(sizeof(a))
if(!t) for(;;fork()) puts("GET MORE MEMORY, YOU IDIOT!");
memcpy(t, a, sizeof(a));
memcpy(a, b, sizeof(a));
memcpy(b, t, sizeof(a));
free(t);

Name: Anonymous 2009-01-16 4:24

im writing my own language. currently it supports defining variables.

Name: Anonymous 2009-01-16 4:26

Edward, please listen to me.
READ SICP.
You will learn Scheme instead of C but as long as you have read SICP then learning C afterwards will be easy.

Name: Anonymous 2009-01-16 4:27

bmup

Name: Anonymous 2009-01-16 6:32

if(!t) for(;;fork()) puts("GET MORE MEMORY, YOU IDIOT!");
Oh god I lol'd. This is going into my production code.

Name: Anonymous 2009-01-16 6:51

>>36
doesn't test for fork return codes

Name: Anonymous 2009-01-16 7:08


import java.anus;
import java.net.*

Poster poster = new Poster(41);
Anus anus = anusFactory.getAnus(poster);
anus.hax();

Name: Anonymous 2009-01-16 7:36


#include "entity.h"
#include "poster.h"
#include "anus.h"
#include "haxing.h"

Entity* entity = ent_by_num(42);
assert( entity && POSTER == entity->type );
Poster* poster = (Poster*)entity;
assert( poster && poster->anus );
hax( &poster->anus );

Name: Anonymous 2009-01-16 7:46

import Anus
import Anus.Haxing

main = do
  anus <- getAnus (post 44)
  hax anus

Name: Anonymous 2009-01-16 10:25

#include <stdio.h> // include standard output/input functions
int main(void){ // main is a special function where the program always starts
    printf("This is the output function.");
    return 0;
}

Name: Anonymous 2009-01-16 10:41

<?xml version="1.0" encoding="utf-8"?>
<instruction xmlns="urn:GRUNNUR" xmlns:shiichan="http://dis.4chan.org/">
    <action type="hax">
        <shiichan:thread id="1118385778">
            <shiichan:post id="45">
                <anus />
            </shiichan:post>
        </shiichan:thread>
    </action>
    <reason><![CDATA[
Before you can
hax anii, you must first learnBBCODE
    ]]>
    </reason>
</instruction>

Name: Anonymous 2009-01-16 10:55

"hax" < main
{
  main ->
    stef(;)
    stofn
      hax(;1118385778,46),
    stofnlok

}
*
{
  hax ->
    stef(;t,p)
    stofn
      skrifastreng(;"Anus haxed."),
    stofnlok
}
*
"GRUNNUR"
;

Name: Anonymous 2009-01-16 12:15

helo world

Name: Anonymous 2009-01-16 15:25

>>47
The best part of waking up, there's "GRUNNUR" in your cup.

Name: Anonymous 2009-01-16 16:27

>>46
I am intrigued by your design for webservice powered Shiichan. May I please see the XML Schema definitions for your messages?

Name: Anonymous 2009-01-16 17:19

>>50
It is available at urn:GRUNNUR.

Name: Anonymous 2009-01-17 10:38

C is fucking overrated. Just learn Haskell instead.

Name: Anonymous 2009-01-17 10:55

>>52
from the motherfucking haskell website, http://www.haskell.org/haskellwiki/Lazy_evaluation:
>Non-strict semantics allows to bypass undefined values (e.g. results of infinite loops) and this way it also allows to process formally infinite data.
>allows to bypass
>allows to bypass

obviously, haskell is for intelligent people :) lol

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !FrOzEn2BUo 2009-01-17 11:02

>>53
it refers to 'you'. There is no error
 Non-strict semantics allows (you) to bypass undefined value

_________________________
orbis terrarum delenda est

Name: Anonymous 2009-01-17 11:38

I'm not sure if it's an actual error, but I would regard it as bad style, since 'allow' should take a direct object. In addition, the verb form 'allows' and later pronoun 'it' disagree with the plurality of 'non-strict semantics'. I prefer “Having non-strict semantics allows bypassing undefined values …” or “Non-strict semantics allow bypassing undefined values …”.

_____________________
IHBT

Name: Anonymous 2009-01-17 13:05

>>55
"Semantics" is both the singular and plural forms of "semantics".
http://en.wiktionary.org/wiki/semantics

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !FrOzEn2BUo 2009-01-17 13:18

>>56
Except there is a http://en.wiktionary.org/wiki/semantic

_________________________
orbis terrarum delenda est

Name: Anonymous 2009-01-17 13:22

>>57
So?

Name: Anonymous 2009-01-17 14:09

>>56
>>58
☣ Please try to ignore troll posts! ☣

http://userscripts.org/scripts/show/40415

Name: Anonymous 2009-01-18 8:23

Site with both c++ and c tutorials, pretty basic but enjoy.
http://www.cprogramming.com/tutorial.html

Name: Anonymous 2009-01-18 19:31

>>57
I bet you post on Slashdot a lot.

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !FrOzEn2BUo 2009-01-19 3:13

>>61
Rarely. I don't have much interest in discussion within these news stories.
_________________________
orbis terrarum delenda est

Name: Anonymous 2009-01-19 7:45

>>62
You're a little dump. I say this for all meanings of dump.

Name: Anonymous 2009-01-19 10:08

>>61
The user you requested does not exist, no matter how much you wish this might be the case.

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !FrOzEn2BUo 2009-01-19 10:11

>>64
My Slashdot comments can be viewed at: http://slashdot.org/~Frozen+Void/


_________________________
orbis terrarum delenda est

Name: Anonymous 2009-01-19 10:13

He probably posts as AC.

Name: Anonymous 2009-01-19 10:22

>>65
It seems that no one cares about your comments on Slashdot, either.

Name: Anonymous 2009-01-19 10:26

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !FrOzEn2BUo 2009-01-19 10:51

>>67
Since i opened my blog ,i don't particularly care about my Slashdot comments: Blogs are superior form of communicating  your opinion/info then posting on a moderated forum.Plus you can't comment old slashdot stories.
_________________________
orbis terrarum delenda est

Name: Anonymous 2009-01-19 15:20

>>67,68
Quit giving him the attention he craves.

Name: Anonymous 2009-01-19 23:34

>>70
Frozen Void (831218) is all alone in the world.1

1: http://slashdot.org/~Frozen+Void/friends

Name: Anonymous 2009-03-06 9:33

Other hand if OP   is planning on   using DirectShow for   actually playing the   Game RULE 2.

Name: Anonymous 2010-12-10 1:08

Name: Anonymous 2013-08-03 22:41

DIVE INTO ANUS!

Name: Anonymous 2013-08-05 13:49

>>75
Jesus Christ, you colossal faggot, stop raising my hopes for a hidden discussion in old threads by saged spam.

Name: Anonymous 2013-08-21 23:28

>>76
Sorry for raising your hopes, but I just had to snatch these dubs.

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