Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe
Visuacl C++ 2008 Express Edition

It has the added benefit of being able to create nice GUI's.

Adbot
ADBOT LOVES YOU

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

JoeNotCharles posted:

Uh, Visual C++ doesn't have a monopoly on nice GUI's. I'm not even sure what you mean by that - a compiler that couldn't be used to compile a GUI is pretty useless.

It's also an IDE that lets you create windows forms and see what they are going to look like.

edit: IDE != Compiler, but it still a benefit you get with Visual Studio.

Janitor Prime fucked around with this message at 19:26 on Mar 5, 2008

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe
Hey can I ask you guys to critique my code? I wrote a mastermind game using RPC and I have a feeling there is a memory leak in the server.

http://codepad.org/gqDb9m76
http://codepad.org/5KT3eVmy

These defines are in the mastermind.h file in case you are wondering.

#define SLOTS 4
#define COLORS 8
#define TRIES 10

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe
Thanks for the tips Plastic Jesus. The reason that loop is so weird is because I'm supposed to give a 0 when they guess the right color but it's not in the correct position and a 1 when it's the right color and the right position.

Also I had never thought about calloc returning a null pointer. What is the best course of action in that case? I can't just exit the server because the client would be left hanging for who knows how long.

You were right about their being no calls to free in the server. Since result is a static variable I just check to make sure that it's not null and free it at the beginning each time. That should ensure that it's not leaking memory each call.

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Hubis posted:

here's a teaser

code:
#include <stdio.h>
void main() 
    { printf("%d\n", 1["1234"]); }
outputs what and why?

Ok wtf is 1["1234"] supposed to mean? Things like this really piss me off about C++. I know you can use the [] operator to move positions in memory. What I don't know is how "1234" is a valid offset. I guess you could use it's memory address as the value, but then how can you know where the compiler will place it? The other thing that bugs me is that 1 is a constant, so 1[] doesn't really make sense to me.

Please help my plebeian brain :(

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Avenging Dentist posted:

Realtalkin', I wish I knew how to build parse tables manually. Maybe one of these days I should get a book on lexing/parsing.

After looking the poo poo that yacc and lex spit out I don't relish the idea.

Adbot
ADBOT LOVES YOU

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Nippashish posted:

Seconding Dev-C++ being a terrible IDE. CodeBlocks is nice and light and much less terrible than Dev-C++.

CodeBlocks also has the advantage of being cross platform if that's important to you. DevC++ is a pile of poo poo, and I can't believe I had to use that for my C++ class. :barf:

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply