|
Awesome, this'll be a good place to ask. Which should I learn, or if both, which first? I like the looks of C, plus I just put Linux on my laptop and have a linux programming ebook for some low level C programming. I've used C++ for a little bit before, working out of that gigantic red C++ book (can't remember the name), but I don't remember getting into any O-O stuff. I'm currently learning Java in school, and I'd like to pick up another language along the way. I'm also a little confused. Is there a difference between C++ and Visual C++? Does the Visual part of it just mean the Microsoft IDE, or is it more to do with libraries and specifically GUI programming?
|
# ¿ Feb 16, 2008 04:42 |
|
|
# ¿ May 6, 2024 01:49 |
|
Is the Ansi C Programming Language a good book to learn C from if you're familiar with the basics of programming, or are there better books to start with?
|
# ¿ Feb 20, 2008 07:01 |
|
Professor Science posted:is this Kernighan and Ritchie? K&R is *the* book Yes, but is the one I'm talking about the right one? I know the K&R "style" is supposed to come from the first edition, and that the second one is the ansi style. Should I be using the first or second edition?
|
# ¿ Feb 20, 2008 07:11 |
|
Professor Science posted:absolutely use the second edition Alright thanks
|
# ¿ Feb 20, 2008 07:17 |
|
Ari posted:GCC's not linking in certain libraries in the C standard library. I can't find any documentation anywhere to help me figure out how to link these in, or force GCC to always link whatever's necessary - any ideas? You may or may not have it, but "apt-get install build-essential" will solve a lot of problems. You probably already have it though if your compiler is working.
|
# ¿ Feb 21, 2008 19:26 |
|
Ari posted:I didn't, and this fixed it entirely. Thanks Woohoo, I finally gave something back to CoC Ok guys, I promise this is the last question I'm going to ask about learning before I put my head in a book for a while. I'm learning C and C++ kind of at the same time. So far it's not a big deal since I'm able to differentiate pretty well between the two. I'm using "The C Programming Language" for C, and I just bought this for 7 bucks at a used bookstore: http://www.amazon.com/Problem-Solving-C%2B%2B-Including-Laboratories/dp/0534400051/ref=sr_1_1?ie=UTF8&s=books&qid=1203928841&sr=1-1 I realize there are better books out there, so should I stick with this one or pick one up? The cost doesn't matter much to me, so if I can do a lot better with something else, I'd prefer to. Otherwise, I'll stick with this. What do you guys think?
|
# ¿ Feb 25, 2008 09:43 |
|
Ari posted:But why are you learning both C and C++ at once? Heh, because I can't stop myself from wanting to mess with one or the other. So far it hasn't really been a big deal, but if it gets to the point where I can't separate the two, I'll stick with one.
|
# ¿ Feb 25, 2008 19:30 |
|
Professor Science posted:Stick with C at first, because you will get confused between pointers and references and arrays and STL containers and new and malloc and all the things they do differently. Once you can look at C++ and see how it's built on top of C clearly, it will make a lot more sense. Alright I'll do that. I'm probably going to pick up a paper copy of K&R today, was just surprised that it's still $50 at the bookstore. edit: Woohoo bought it. Oh, and I was thinking, if anyone else is learning C and wants a study buddy of sorts, I'd be down for it. I learn a lot better when I have someone to bounce concepts off of. fret logic fucked around with this message at 04:38 on Feb 27, 2008 |
# ¿ Feb 26, 2008 22:25 |
|
Mikey-San posted:K&R is so completely worth it, though. You'll be very glad you bought it. Chapter 5 of that book is a beautiful piece of technical writing, and probably the best tutorial on pointers I've seen. I don't doubt it. From what I've heard about it, and from what I've got through so far, it's great. It helps that I really enjoy programming and technical books, but yeah I like it so far
|
# ¿ Feb 27, 2008 05:49 |
|
Ok this is kind of a stupid question but I can't figure out why this works the way it does. I'm working with the getchar() and putchar() functions in C, and I don't understand how this loop is working:code:
Especially when... code:
|
# ¿ Feb 28, 2008 06:15 |
|
Scaevolus posted:Use Control-D to send an EOF character. (In Linux, at least) How is this different from the one without the loop? It'll let you type in an entire string, but only returns the first character. Are you saying that once you hit enter, it repeats the loop for each character in the line? I guess I'm not understanding how the loop affects the process.
|
# ¿ Feb 28, 2008 06:27 |
|
Ok now I feel really stupid, but it's still not clicking for me. If I rearranged the program to:code:
edit: oops code is wrong in this one ^, fixed it, and tried on my laptop, it gives the same output as the first loop, so I'm still confused :/ fret logic fucked around with this message at 06:56 on Feb 28, 2008 |
# ¿ Feb 28, 2008 06:50 |
|
Lexical Unit posted:3: c becomes the return value of getchar(). getchar() will not return until the end of file or end of line is reached. So in your example let's say you type in a word like "stuff." Lexical Unit posted:3: c becomes the next character from stdin, you've already given the next character before, it's "t". getchar() won't wait for you to hit enter this time because it doesn't need to. Thanks man, the bolded parts did it for me this time. That's what I was having so much trouble understanding, was that it kept an entire line in the memory, and that in the first one without the loop, it only printed out the first letter because I only called the putchar() function once. I'm going to do some more research on stdin now Lexical Unit posted:Can't you use Visual Studio Express — it's free to download. Haha yeah I have it installed on here, but given that I haven't figured out how to use it, it annoys the ever living piss out of me. It's far too much labor for a simple C program like that, I am a freak for command line compiling now.
|
# ¿ Feb 28, 2008 08:53 |
|
What are some good websites besides Euler with stepping programming tasks that you don't have to know an entire language to do? Like ones you can do while learning a language
|
# ¿ Feb 29, 2008 07:41 |
|
Where's a good place to start for programming simple graphics in C? Nothing fancy, just lines or pixels to get me started. I've tried to decipher the source code for nethack, as far as how they print the ASCII characters in different places, and it's a bit above me heh.
|
# ¿ Apr 1, 2008 01:30 |
|
|
# ¿ May 6, 2024 01:49 |
|
HB posted:Manipulating a character display the way NetHack does isn't really the same as "lines or pixels". Yeah I know that much, I just haven't found the basic idea behind the graphics in that game, graphics that for some odd reason I really enjoy.[/QUOTE] HB posted:The best way to quickly make something appear on the screen is probably OpenGL with GLUT. A program that opens a window and draws some simple shapes can come in under 30 lines. Once you're comfortable with that, you can leave GLUT behind to do your own context setup, and you're off and running. Oh I never realized I'd have to use something like OpenGL. Haha I thought it'd be like QBASIC and have a command or two for drawing to the screen, I'm retarded. Thanks though, I'll look that up! edit: I checked out some of the sample source code, thanks again this is exactly what I was looking for fret logic fucked around with this message at 01:52 on Apr 1, 2008 |
# ¿ Apr 1, 2008 01:47 |