MosaicFuneral 812 Nearly a Posting Virtuoso
MosaicFuneral 812 Nearly a Posting Virtuoso

They are all violent -- do something useful with your life instead of wasting it on stupid games.

On a daily basis, how often do you use the phrase "get off my lawn", "back in my day", or "young wippersnapper"?

jbennet commented: Epi +0
MosaicFuneral 812 Nearly a Posting Virtuoso
MosaicFuneral 812 Nearly a Posting Virtuoso

Started with QBasic, had fun, but hated it at the same time. It was when I went to C that it all kind of made sense and I could make practical tools and not just speaker beeps and pixelated screens. Java would be good too with all the libraries that you can have fun with, out of the box.

But I suppose there's VisualBasic, it's what some schools try to teach. I hate it and think it's twelve times more frustrating than assembly(that's my opinion obviously), but you can play with all the IDE tools and make fancy GUIs and tools right off the bat with no programming experience, and that's why they teach it.

MosaicFuneral 812 Nearly a Posting Virtuoso

Here: http://msdn.microsoft.com/en-us/library/windows/desktop/ms682022(v=VS.85).aspx

Disregard the first example and scroll down to see proper handling of a Windows console.

MosaicFuneral 812 Nearly a Posting Virtuoso

Upside-down can of dust off and a thrown together electromagnet.

happygeek commented: nice! :) +0
MosaicFuneral 812 Nearly a Posting Virtuoso

Apfelwein spritzer, in a bembel. Nectars and sodas on the side.

MosaicFuneral 812 Nearly a Posting Virtuoso

Just brew some beer, $3-4 a gallon. Or harvest your own wines(including the yeast) for nothing.

MosaicFuneral 812 Nearly a Posting Virtuoso

I don't know how people still fall for these.

MosaicFuneral 812 Nearly a Posting Virtuoso

Probably the best IDE for C++ with MinGW is Code::Blocks. Easiest for a beginner, since it's good to go straight out of the box.

MosaicFuneral 812 Nearly a Posting Virtuoso

这么明显的错误你都发现不了?你到底是不是C++编程人员

Don't be rude. Most posters are beginning programmers, or have had a long night.

NathanOliver commented: darn skippy +2
MosaicFuneral 812 Nearly a Posting Virtuoso

An old snippet -from here(excuse my amateur style, back then)-:

map<string, Element> elements;
    elements["H"]._Element(true, false, false, 1, 1, 1);
    elements["H"].name   = "Hydrogen";
    elements["H"].symbol = "H";
    elements["H"].amu    = 1.00794;

Do you know how to use any other STL containers or pointers/arrays?

MosaicFuneral 812 Nearly a Posting Virtuoso

size_type is just a typedef of size_t in STL containers. For a %100 compatibility, you may want to use size_type, but for the most part it's interchangeable, unless you're following the standard.

MosaicFuneral 812 Nearly a Posting Virtuoso

Wikipedia has your back, broski: http://en.wikipedia.org/wiki/Strcpy

MosaicFuneral 812 Nearly a Posting Virtuoso

It'll work fine, I've done a lot of coding in Bloodshed's Dev-C++ IDE, but it hasn't been updated in years and the compiler it comes default with(MinGW) is long out of date as well, unless you install the new version yourself.

So an IDE that also comes with the latest core compiler and support is convenient.

MosaicFuneral 812 Nearly a Posting Virtuoso

If you were a programmer, you'd know by that logic you could also say, "I know 'Hello' in Chinese, therefore I'm fluent in it". ;P

Anyway, just familiarize yourself with time.h:
http://www.cplusplus.com/reference/clibrary/ctime/

You may want to upgrade from old Dev-C++ to Code::Blocks or VC++ Express 2010.

MosaicFuneral 812 Nearly a Posting Virtuoso

you can also use toupper() or tolower() in <cctype>
or use the falling-through behavior of the switch for 'Y' and 'y' etc.

A label fall-through would probably be best for such a small piece of input.

MosaicFuneral 812 Nearly a Posting Virtuoso

Please use CODE TAGS next time - forum rules.

Shouldn't it be while answer != a valid answer ? Though it seems redundant(and time consuming) to check the variable for all valid answers in the while statement and once again in the if statements.

You could try:

bool valid_answer = false;
while(!valid_answer) { 
  switch(answer) {
    case y:
      ...
      valid_answer = true;
      break;
    case n:
      ...
      valid_answer = true;
      break;
    default:
      ...
  }
}
MosaicFuneral 812 Nearly a Posting Virtuoso

Is it "modeling" or hardcore, and are they obviously under 14 or 16(Interpol says it depends on the circumstances in Russia)? Because then you should contact the FBI.

This article may be from nine years ago, but nothings changed the reality of it: http://www.russiajournal.com/node/5808

MosaicFuneral 812 Nearly a Posting Virtuoso

:,( Very unfortunate. He was only 23 and accomplished?

MosaicFuneral 812 Nearly a Posting Virtuoso

I've been flagging things since I joined; don't think there needs to be a reward expected for pointing out the trash for the janitor to clean.

Isn't there a way of viewing all recently created threads by new members?

MosaicFuneral 812 Nearly a Posting Virtuoso

I think they'll understand the kid forgetting his meds and flipping out. It's the internet.

MosaicFuneral 812 Nearly a Posting Virtuoso

strtok(), or read it a character at a time and end reading there if you reach a character you want to delimit on on.

MosaicFuneral 812 Nearly a Posting Virtuoso

Read the section in the chapter that tells you how to use new to allocate a pointer - otherwise, this example should explain it all: http://www.cplusplus.com/reference/std/new/operator%20delete%5B%5D/

MosaicFuneral 812 Nearly a Posting Virtuoso

Don't have a cellphone, and this is another reason why.

MosaicFuneral 812 Nearly a Posting Virtuoso

If you wanted to compare the raw speed of two algorithms on a specific system, you just run them a few thousand times and get the recorded run time difference.

MosaicFuneral 812 Nearly a Posting Virtuoso

uhh.... No. Debugging is the act of resolving those issues and no one's going to do it for you(unless you like spending money).

MosaicFuneral 812 Nearly a Posting Virtuoso

You should try Code::Blocks, Dev-C++ has become very out-of-date, but the debugger on both works the same.

http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks

You can setup break-points to step through, and a watch on those variables.

MosaicFuneral 812 Nearly a Posting Virtuoso

What IDE are you using? Most have an easy to use one that requires nothing more than clicking on a line to watch it.

MosaicFuneral 812 Nearly a Posting Virtuoso

Use a debugger and follow the code.

MosaicFuneral 812 Nearly a Posting Virtuoso

You need to allocate the outer pointer first, than the sizes of the inner pointers.

On 'For' it should be 'for'.

main() should be an 'int' and successfully return zero on completion.

MosaicFuneral 812 Nearly a Posting Virtuoso

You still using two actions in a scope that only uses one...

Why don't you just put the printfs at the end of program as I suggested? This eliminated this issue, and doesn't print the message a dozen times on the console.

Your loop still doesn't even encase the conditions, and you still haven't moved the variable initialization to the top.

MosaicFuneral 812 Nearly a Posting Virtuoso

If the code following is only a single action, then you don't need brakets but if you're using more than one you need:

if(logic) 
{
    func();
    func2();
}
else
    only_one_func();

something_now_outside_the_scope();
MosaicFuneral 812 Nearly a Posting Virtuoso

So were you suppose to fill in the blank space loop with your code?

You need to actual encase the loop in brackets, and add one to your else statement.

You need to initialize those variables as zero, if you do it in the loop you reset it every time.

You can place the printfs outside of the loop at the end of the program so they don't repeat everytime you add a number.

Simplified, something like this:

for(...) {
    if(array[i] & 1)
        odd++;
    else
        even++;
}
...
MosaicFuneral 812 Nearly a Posting Virtuoso

Look up Big-O Notation and keep this chart handy: http://www.cppreference.com/wiki/complexity

Snehamathur commented: Thanksss +1
MosaicFuneral 812 Nearly a Posting Virtuoso

I agree. I don't recall ever seeing a drunk Ninga or a boozed-out rugby team play :)

Drunken MMA fighters taking on hungover ruby teams could be the future. I know I'd pay to see it.

MosaicFuneral 812 Nearly a Posting Virtuoso

We aren't the wild west you see in the movies.

Since that Wild West never really existed in the first place.

http://www.cracked.com/article_18487_6-ridiculous-history-myths-you-probably-think-are-true.html

MosaicFuneral 812 Nearly a Posting Virtuoso

Well, who needs guns and knifes when you have palm trees and tabloid papers.

MosaicFuneral 812 Nearly a Posting Virtuoso

What system are you on that doesn't have a freely available C++ compiler?

MosaicFuneral 812 Nearly a Posting Virtuoso

Why are weapons such a taboo subject in the UK? Seriously, you guys are afraid of having pointed ends on a kitchen knife.

http://news.bbc.co.uk/2/hi/4581871.stm

Getting guns into the UK is a lot more difficult than you might imagine, especially in these days of heightened terrorist alerts.

Which is why I've heard many of them are made over there out of 35k-PSI pipes. Obviously open-bolt, automatic submachine guns, since they have braindead mechanics.

MosaicFuneral 812 Nearly a Posting Virtuoso

I thought the only thing you had to avoid was the petrol abusers, sort of like crack/meth-heads?

Wombats just sound like a cross between a boar and a mole.

I heard that a Canadian is an American without the gun.

I've heard they loves their guns.

MosaicFuneral 812 Nearly a Posting Virtuoso

A constant sized array is fine if you only ever require that size. Check out <vector> if you want a dynamic solution.

Nick Evan commented: Good advice +12
MosaicFuneral 812 Nearly a Posting Virtuoso

You're confusing the lax C++string container method with the C way.

http://www.thinkage.ca/english/gcos/expl/c/lib/strcmp.html
http://www.cplusplus.com/reference/string/operators/

edit:
Wow, everyone replied at the same time.

MosaicFuneral 812 Nearly a Posting Virtuoso

Just place the template outside the class: http://www.cplusplus.com/doc/tutorial/templates/

MosaicFuneral 812 Nearly a Posting Virtuoso

SomeClass::*funcptr doesn't exist, its not a SomeClass member. I believe it would be something more like:

typedef int (*fp)(int, char*);
class MyClass{
public:
    fp *funcptr;
}

I cannot confirm that is correct, I need to oil up the rusting gears in my head. I generally don't use pointer functions unless I'm using a raw code catalyst of sorts. I'm sure someone will sort this out.

MosaicFuneral 812 Nearly a Posting Virtuoso

You never declare 'funcptr', you just have it randomly appearing in main() referencing something. It also can't be declared in main() and then used as a type in your outside defined class.

MosaicFuneral 812 Nearly a Posting Virtuoso

Are you trying to declare a SomeClass member from inside of MyClass?

MosaicFuneral 812 Nearly a Posting Virtuoso

Sequential cases and macros are nice and clean with enums: http://gnuvince.wordpress.com/2009/09/08/enums-in-c/

MosaicFuneral 812 Nearly a Posting Virtuoso

You can upload the file here, as long as you own it(not someone else's property). No one's going to risk it downloading things offsite.

Anyway: http://en.wikipedia.org/wiki/Primitive_data_type#Integer_numbers

You may want to learn a simpler language first.

MosaicFuneral 812 Nearly a Posting Virtuoso

The best you can do is disassemble it. If you know how all the code went already, sometimes its pretty easy to rewrite it all.