ArkM 1,090 Postaholic

As far as I know, SQLCHAR is a typedef for unsigned char* (or signed char* in other versions). If so, use brutal force method (in C style):

strcpy((char*)szString,"Let's Try This!");
Frederick2 commented: helped me a lot. i was stuck +1
ArkM 1,090 Postaholic

Don't waste the time for writing random pieces of codes. You have rather serious task, start from the Project Plan.

You must study some theoretical issues before to start your program design. Search INET for random number generation theory and basics of statistical simulation. Wikipedia is a good start point for your studies.

It's absolutely uninteresting thing to ask your system about any runway or airplane status. The main goal of any statistical simulation program is to produce then save for future analysis all required statistics (see your project specifications). So don't rack your brains over simulation menu switches and displablabla family functions. You need two different programs (airline network file generator and simulation engine) with minimal interactiveness.

It seems you have too restrictive requirement:

You are free to choose the random number generator and priority queue you wish to use, but you must implement these from scratch (as opposed to using a canned library).

Really good random number generator implementation "from the scratch" is more compicated task than all the rest of your project. In practice all serious people in simulation world use professional-made generators (such as famous MersennTwister implementation). I think, you may extract some codes from the public domain implementations (search INET again). Good uniform distributed pseudorandom numbers generator is the key point of any sucsessful statistical simulation package. It's so easy to get exponentially (or what else) distributed random numbers from uniform random stream. No ready to use functions in C …

Ancient Dragon commented: very nice comments :) +34
ArkM 1,090 Postaholic
  1. I don't understand what do YOU want in the code after cout << "What object do you want?";. May be, come back to design stage (or earlier)? In actual fact, your objects have the only attribute - name. The user can identify (type in) object name. Possible search results: yes or no, found or not found? Think before coding...
  2. It seems no properly declared iterators in this point. Please, present current version of your code (don't forget code tags).
  3. Try to use Vernon's SearchVector function (adopt it for vector<objects> - apropos, strange class name for only object with a name). May be, better prototype (and header) for this function is:

int SearchVector(const vector<objects*>& allObjects, const string& aString);

VernonDozier commented: Yes. const modifiers should have been in my function. +5
ArkM 1,090 Postaholic

May be this function is infected by extremely malicious stealth virus which is capable to hide not only its binary image but source code too...

Alex Edwards commented: That was hilarious! +2
ArkM 1,090 Postaholic

In other words, you are trying to make choice between a Ford car and Ford Crown Victoria Interceptor. Truth to tell, Microsoft tuning adds 5-th wheel (NET extensions) to this wonderful model...

mitrmkar commented: LOL, metaphor of the week I'd say +4
ArkM 1,090 Postaholic

The only way to search in std::vector - scan the vector with iterator (from begin() upto end())) and compare search string with (*iter)->name.

If you want fast (better than linear) search, see std::map class with find member function.

Apropos, it seems you need delete *iter; , not delete (*iter)++; . See what happens in your case:
- Dereference iterator - get a reference to pointer to object (from the vector) - delete the object via this pointer- increase THIS POINTER in the vector. Why?

ArkM 1,090 Postaholic

The answer: yes, it's legal - but totally senseless. It's the same as:

int main()
{
    12345;
    return 0;
}

If you want, we call int "constructor" then immediatly discard created object. So internal constructor in actual fact creates local (in outer constructor body) object of the same type. Of course, after closing semicolon destructor was called.

Try this for the constructor with 1 arg (simple and clear code):

#define STD_NUMBER_OF_COLMS 1   //standard number of columns
MyFileExtractor::MyFileExtractor(string fname):name(fname),
columns(STD_NUMBER_OF_COLMS)
{}

If you need lots of constructors, move common codes in a private member function then call it in every constructor. It's a standard way to go.

Ancient Dragon commented: Glad we agree :) +34
ArkM 1,090 Postaholic

These typedefs and macros were created by MS team in early Windows era in the interests of portability.
See brief summary and historical introduction:
http://en.wikibooks.org/wiki/Windows_Programming/Handles_and_Data_Types

William Hemsworth commented: Thanks for the link +2
ArkM 1,090 Postaholic

Caret does not denote a pointer. It's MS .NET extention for handler of GC heap object.
See, for example:
http://www.visualcplusdotnet.com/visualcplusdotnet14c.html
Forget portability (in C++?!) with hats, gcnew and other MS VC++ tricks...

VernonDozier commented: Thanks for the explanation. +5
ArkM 1,090 Postaholic
Q8iEnG commented: Thanks for the small help :) +1