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

Learning C through K&R book

Name: Anonymous 2011-08-24 21:12

I already compiled and ran my first code but there's this thing.
When I run it, cmd flashes and disapears.(I'm using Dev-C++ on windows to make it)
Anyways, I think there was a command or function to make the cmd pause till I press enter or something like that so that I am able to read whatever the output was, the thing is, I cant remember the name of the function or how to write it.
Can one of you tell me which it is, if there is one.
BTW here's my code:


#include <stdio.h>

main ()
{
  printf("Hello World!");
}

Name: Anonymous 2011-08-25 23:21

>>40
Why does batch have a function to pause the program till acknowledged but C which is supposed to be OH SO GREAT doesn't?

And it's not the same at all.  He removed the "getchar()" and added "int argc, char *argv[]" and that "ANUS" crap".
Anyways, I added the gerchar and when I ran it, it wouldn't stay open.  I think it has something to do with "int argc, char *argv[]" but I do not know.

Name: Anonymous 2011-08-25 23:37

Why does this thread even exist.

Name: Anonymous 2011-08-25 23:54

>>41
Because C doesn't have a user interface.  Stop being stupid.

Name: Anonymous 2011-08-26 0:53

>>41
You said it worked in >>3, asshole.
It has nothing to do with main's arguments. Now finish reading K&R .

Name: Anonymous 2011-08-26 0:55

>>29

Javascript is usually a good first language.

I agree, Javascript is a fantastic first language. Here's a protip though, Javascript is unlike any language you will ever program in. It has functional elements, and a prototype system. It doesn't have block scope, but function scope. There are plenty of things I could go into but this list would get quite long.

Here's my suggestion if you want to learn Javascript. Firstly, get Firefox because it has Firebug. Next, read Eloquent Javascript. Next, read Javascript : The Good Parts by Doug Crockford while watching his videos at YUI Theatre. That should get you going.

Javascript's community is changing and it's quickly becoming one of the best. With the information I just gave you you're well on your way to becoming a good programmer.

Lastly, don't think that Javascript is just a client side scripting language. Frameworks like Node.js are quickly changing that and exploiting Javascript's natural elegance.

Name: Anonymous 2011-08-26 1:00

>>45
Javascript is an awful first language because it's nothing like any language you will ever program in.

The reason C is the best beginner programming language is because it teaches you how to program, plain and simple. It's as close as you can get to pure programming.

Name: Anonymous 2011-08-26 1:05

>>45
Javascript is an awful first language because it's nothing like any language you will ever program in.

The reason Lisp is the best beginner programming language is because it teaches you how to be an autistic neckbeard, plain and simple. It's as close as you can get to pure /prog/.

Name: Anonymous 2011-08-26 1:16

The reason C is the best beginner programming language is because it teaches you how to program, plain and simple. It's as close as you can get to pure programming.
( ≖‿≖)

Name: Anonymous 2011-08-26 1:21

>>48
Name a better example.

Name: Anonymous 2011-08-26 1:33

>>49
it teaches you how to program, plain and simple. It's as close as you can get to pure programming.
What does this even mean?

Name: Anonymous 2011-08-26 1:36

>>46
The reason C is the best beginner programming language is because it teaches you how to program, plain and simple. It's as close as you can get to pure programming.
So basically what I read in >>23
about how C is as close to assembly as you can get, was correct?

Name: Anonymous 2011-08-26 1:42

>>48
Pure programming, eh?
That would be Lisp, or it would be anything turing equivalent. It would be... arithmetical statements and logic.

Name: Anonymous 2011-08-26 2:14

>>52
S and K combinators are the Purest.

Name: Anonymous 2011-08-26 2:34

>2011
>not using codeblocks
>oh-wait-i-can't-post-reaction-images-on-a-text-board.jpeg

Name: Anonymous 2011-08-26 3:01

\bbox[position:fixed;left:0px;top:0px;width:100%;height:100%; z-index:-1;background:url( http://www.wired.com/geekdad/wp-content/uploads/2009/09/carl_sagan.jpg); background-size:100%;]~\phantom{gafdf}

Name: Anonymous 2011-08-26 3:12

>>55
This is not /sci/, get out.

Name: Anonymous 2011-08-26 3:19

>>52
Lithpfags are so delusional.

Name: Anonymous 2011-08-26 3:23

>>57
Pureness is a subjective property that someone defines for themselves, hence nobody can be delusional when defining what is essentially their personal opinion about a meaningless word.

Name: Anonymous 2011-08-26 3:36

>>58
Purity is not subjective.

C is closer to pure programming than Visual Basic. End of discussion.

Name: Anonymous 2011-08-26 3:46

>>59
It means different things to different people. You're just refusing to acknowledge the fact that other people have different opinions than you.

Name: Anonymous 2011-08-26 4:40

>>59
Purity is subjective when there is no reliable definition.

Name: Anonymous 2011-08-26 4:55

>>61
Purity is purely subjective.

Name: Anonymous 2011-08-26 7:22

>>62
Lisp is purely objective.

Name: Anonymous 2011-08-26 14:24

>>60
>>61
100% concentration H2O being more pure than sea water is subjective. Go figure, lithpfags.

Name: Anonymous 2011-08-26 14:24

Fjölnir is purely "GRUNNUR"

Name: Anonymous 2011-08-26 14:37

There was a time when this thread was about programming.

Name: Anonymous 2011-08-26 14:41

>>66
Ah, those were the good ol' days :')

Name: Anonymous 2011-08-26 14:53


#define ANUS int main(void){
#define IN printf("FUCK ANUS IN THE ASS");
#define THE   return 0;
#define ASS  }
#define FUCK ANUS IN THE ASS

FUCK

Name: Anonymous 2011-08-26 16:46

>>68
Forget to include a header or two?

Name: Anonymous 2011-08-26 17:42

>>69

FUCK GOD DAMNIT FUCKING SHIT PIECE OF NIGGERS FUCK FUCK FUCK INCLUDE STUDIO MY ANUS

Name: Anonymous 2011-08-27 4:36

this thread... it's dildos

Name: Anonymous 2011-08-28 2:23

I'm not about to let this thread off the main page before it reaches 100 posts.

So here's something /prog/ related:
Actually fuck that!,
bump.

Name: Anonymous 2011-08-28 2:44

Not the OP, but I was reading K&R as well and I something has been confusing me.

In the book, they use have code like this:


#include <stdio.h>

main() {
  int c;
 
  while((c = getchar()) != EOF)
    putchar(c);
}


Problem is this produces an infinite loop for me since it never gets to EOF...

Name: Anonymous 2011-08-28 2:51

>>73
Ctrl+D.

Name: Anonymous 2011-08-28 8:17

>>73
That program is supposed to read from a file, not your keyboard. try ./out < infile -- it should cat the file to stdout.

Name: Anonymous 2011-08-29 20:29

Name: Anonymous 2011-08-29 21:26

>>75
EVERYTHING is treated as a FILE. That includes your keyboard

Name: Anonymous 2011-08-30 20:20

>>77
How does it know you've finished inputting your ... keys, then?

Name: Anonymous 2011-08-30 20:35

Name: Anonymous 2011-08-30 21:17

>>78
use the EOF. [spoiler]IHBT

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