MosaicFuneral 812 Nearly a Posting Virtuoso

Just easier to read.

MosaicFuneral 812 Nearly a Posting Virtuoso

You could simplify 3-7: if(a || a<4 || !(a&1) || a<9 || !(a%3)) return(false);

MosaicFuneral 812 Nearly a Posting Virtuoso

If you want to know for certain, read this: http://www1.idc.ac.il/tecs/plan.html

MosaicFuneral 812 Nearly a Posting Virtuoso

... to answer your question, home grew....but really, are you going to tell me there are no cons for OOP? because if that is the case, then there would be no need to develop anything on non-OOP languages.

Also, now a days of course we are no going to run into any memory costs due to the large amount of memory most of our systems have for the OS; however, CPU memory is always limited by the manufacture, so if your treads require more resources than those that can be allocated on the available CPU memory then your program will run slower (correct me if I'm wrong...I'm not an expert on CPU programming nor on how everything is processed in the background)

Alos keep in mind that when running an OS application (which are usually done on OOP) they still need to go through more steps then low level languages before they get executed. So if speed is critical...well you know...you might not want to go with an OO language

You should really learn assembly and some architecture design; then dissect your OOP driven apps to see how they tick. Because I have this hunch that you have no ideal what you're talking about.

MosaicFuneral 812 Nearly a Posting Virtuoso

Yes, it's pretty much a similar concept but you're shoving it all in one oversized function. The example I showed you kept things small, clean, and minimal.

MosaicFuneral 812 Nearly a Posting Virtuoso

Store the string length before hand, add the length of the two strings to find the new length, if the new length is greater than the current capacity then you call to increase the size, then call to have the the data of the new string concatenated to yours.

class String
{
    private:
            size_t length;
            TCHAR  *data;
    public:
            String size() { return(length); }

            &String::operator+=(const String& str) {
              size_t new_length = this->size() + str.size();

              if(new_length > this.capacity())
                this->reallocate_reserve(new_length);

              concatenate(...);
            }
};

That's pretty much what's in the g++(well technically +=() calls append(), but whatever)

BTW, you should read this: http://www.agner.org/optimize/optimizing_cpp.pdf

MosaicFuneral 812 Nearly a Posting Virtuoso

Why do you have all those printf's in +=()? Maybe you should log the values into a record and print it afterwards and wrap it with #ifndef DEBUG.

MosaicFuneral 812 Nearly a Posting Virtuoso

You could give it a try.

MosaicFuneral 812 Nearly a Posting Virtuoso

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

MosaicFuneral 812 Nearly a Posting Virtuoso

Faulty logic. He said "I'm a programmer", not anything about fluency. The argument could be made that one knows Chinese after learning one word, though claiming fluency would be stupid. I think anyone who knows anything about programming can be called a programmer (at which point more details are required to find out how good of a programmer), but I'm curious as to where you draw the line.

Actually I know Chinese, because I know the word 'Chinese', but that's pedantic beyond a quick joke.

MosaicFuneral 812 Nearly a Posting Virtuoso

93-94 can be condensed into: stdnm[10][21]; 95 sub[6][11]; 97-107 mrks[60]; You can simply it's usage with loops such as, for(int i = 0; i < 60; i++) sfil>>mrks[i]; See how that works out?

MosaicFuneral 812 Nearly a Posting Virtuoso

We are know the mother language of computer.And we can generate system as well as application programming.OOPs is a big concept language of orinted program.C language is used for hacking program by hackers.

I'm still trying to decipher this paragraph. You or no collective can be a "know" or a "mother language".

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

Like a for() loop, because it just boils down to drive[1] = pch[1]; Mentioned in your CodeGuru thread, mixing wides with ASCII can lead you into problems from messy code.

MosaicFuneral 812 Nearly a Posting Virtuoso

Convert back? You never empty() the vector so you don't need to do place it back.

MosaicFuneral 812 Nearly a Posting Virtuoso

ok, the second half?

Which?

MosaicFuneral 812 Nearly a Posting Virtuoso

Algorithms: They save lives.

jonsca commented: Thanks for the PSA! :P +6
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

36-37 Are you forgetting something?

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

That would be the set of integers I mentioned.

MosaicFuneral 812 Nearly a Posting Virtuoso

(float)((rand()%10)*0.1) Works for me.

MosaicFuneral 812 Nearly a Posting Virtuoso

We don't do homework, and that'd be academic dishonesty - worse than a late assignment.
Often you're allowed to postpone an assignment if you have -preferably signed- proof of outstanding circumstances.
The paper they give you when you start class tells you who to contact in such events that you'll be late.

MosaicFuneral 812 Nearly a Posting Virtuoso

You better send it now, so you get it as early as possible.

MosaicFuneral 812 Nearly a Posting Virtuoso

Why don't you skip the redundancy of placing this all inside another C-string and just loop through and append the vector's chars into the std::string.

string file_data;

for(size_t i = 0; i < data.size(); i++)
  file_data += data[i];
MosaicFuneral 812 Nearly a Posting Virtuoso

If you want your integer set to become set range of tenths, you just need to multiply rand()'s output by 0.1

MosaicFuneral 812 Nearly a Posting Virtuoso

Have you messaged your professor, most schools also have services like Blackboard to help maintain contact?

MosaicFuneral 812 Nearly a Posting Virtuoso

Remove the whole "10+".

MosaicFuneral 812 Nearly a Posting Virtuoso

Make it a wstring and use c_str().

MosaicFuneral 812 Nearly a Posting Virtuoso

The cursed earth of Mordor. Forged through the remains of Morgoth's wicked sorcery, while The Dark Lord watches high above in the tallest tower of Barad-dûr.

MosaicFuneral 812 Nearly a Posting Virtuoso

AI, and aspects of game design.

MosaicFuneral 812 Nearly a Posting Virtuoso

I don't get how you do this without any software initially? Is this responsibility in the BIOS? If so who writes the BIOS and how?


i think so that BIOS is used initially.

Please stop sig-spamming.

It has to do with logic gates built from transistor-resister combinations that build-up an ALU.
The BIOS will load the first initial code from a designated device's MBS.
The loaded code will point into the OS and initialize everything.
Eventually through user input, the OS may point to code that you've developed.
Skipping over all the loading of headers and crap, it points into the segment with your raw code that is passed to the CPU.
If the opcode at the current position in the code being read by the CU is less than 0x06, then it's an ADD operation(on an x86); based on that the ALU will ADD the correct registers or memory values together.

I hope I explained that right; it's late and I'm tired.

MosaicFuneral 812 Nearly a Posting Virtuoso

Not sure what range of tools, but some would include:

  • MASM32
  • Cheat Engine
  • Code::Blocks w/ MinGW
  • Visual C++ 2010 Express
  • Open Office
  • GIMP
  • Audacity
  • Blender
  • Run Alyzer
MosaicFuneral 812 Nearly a Posting Virtuoso

.... Don't believe everything you read!


god is real.

So are saying God is real, or isn't - because I have to question everything you say now, after your statement(even the statement itself, as a double negative)?

MosaicFuneral 812 Nearly a Posting Virtuoso

A processed meat[s] in a can that has become popular in many Pacific islands and probably why Guam is ranked so high in obesity.

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

To go a year without perpetuating a racial genocide.

MosaicFuneral 812 Nearly a Posting Virtuoso

Wouldn't tickboxes indicate items to be played, so why would you go about ticking them all?

Create a temporary play list, and an item list with items that are left to be added. You randomly pick an item out of the to_add list, add it as the next item in the shuffle_play_list and remove it out of the to_add list.

Concept code:

while(to_add.size > 0)
{
  random_item = rand()%to_add.size;
  shuffle_play_list.add(to_add[random_item]);
  to_add.remove(random_item);
}
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

There's several billion meat-based systems in this world.

MosaicFuneral 812 Nearly a Posting Virtuoso

I don't known much about PHP, but can you use a pipe or set up a socket connection?

MosaicFuneral 812 Nearly a Posting Virtuoso

Think ahead and realize what direction you're coding in; use a creative name system, and then there is no need for a dynamic scope.

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

It's more than likely proprietary, and Apple is its own totalitarian regime when it comes to trade secrets.

Audio engineering is not something I'm quite studied in.

MosaicFuneral 812 Nearly a Posting Virtuoso

You have to make the functions, it even says you can do it in the directions.

Read(at least skim the examples) this: http://www.cplusplus.com/doc/tutorial/classes/

MosaicFuneral 812 Nearly a Posting Virtuoso

That's because members of a class default to private if you don't give the access specifier. You have to access it through the public functions, as I mentioned.

MosaicFuneral 812 Nearly a Posting Virtuoso

Member rule:

  • Do provide evidence of having done some work yourself if posting questions from schoolwork assignments

Open up the file in an ifstream, read with getline(istream& is, string& str).