Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. djimm100

    Trouble with VC++ compiler

    My VC++ compiler (Studio 6.0, service pack 3) is behaving oddly. It seems to not be compiling changes I make to a file. For instance, I might put a statement like this into a function: cout << &quot; * * * Testing this function * * *\n:&quot; It will compile fine, I'll debug the function...
  2. djimm100

    Assertion Failure in cout.

    I have this statement in a function: cout << m << &quot;, XSet ID# &quot; << temp_xid; m is a pointer to a string. temp_xid is an unsigned long. For some reason, an assertion failure is occurring inside cout every time I try to pass a numeric constant or variable. temp_xid, long, int, short...
  3. djimm100

    char --&gt; short

    The simplest way is to say: char c = '9'; short int n = c - '0'; If 57 is the ASCII value of '9' and 48 is the ASCII value of '0', then n will be assigned 57 - 48, which is 9. This will work for any ASCII digit character.
  4. djimm100

    newbie question on classes

    RE: What's the point of returning a coordinate class? Because that way you can return two values, x and y, simultaneously. Otherwise, you would have to pass them by reference through the parameter list (keep in mind that a class is really just a struct). Also, it is often conceptually easier to...
  5. djimm100

    Simple array question

    C was designed to program the unix operating system and to give maximum control to the programmer, so the programmer must check bounds on his/her own. C++ continues this tradition. Pascal and BASIC were designed by university instructors to teach programming concepts, so they do many mundane...
  6. djimm100

    Can't define template member function in .cpp file

    Kudos to Matt (Zyrenthian) and Toby (LF28). The problem can be solved in at least two ways, by putting #include &quot;Example.cpp&quot; in either the driver file or by putting it in the Example.h file after the class declaration. I think putting it in the header is more reliable, but just to...
  7. djimm100

    Can't define template member function in .cpp file

    For the life of me, I can't figure out why this doesn't work. I've carefully double checked my work. Here's the problem: I have a header file that looks something like this: // Example.h // #include <iostream> using namespace std; #ifndef Example_h #define Example_h template...
  8. djimm100

    typedef a template class

    I have a header file with a class declared like so: template <class Item> class ItemJArray { ... }; I want to typedef this in a source file, but this does not work: typedef ItemJArray JArray; I want JArray to behave exactly like ItemJArray. Specifically, I want to be able to...

Part and Inventory Search

Back
Top