oRg 0 Newbie Poster

I remember doing something very similar in my assembly class a few years back.

We were using the old 8086/8088 Intel Developer Boards (circa 1979), and I remember we had to use the "in" and "out": commands in order to communicate with the serial port.

Here's some examples:

MOV 	DX, 800EH	; Assigns the input port address to register DX
IN	AL, DX		; Reads the input from port DX, and stores it into AL
MOV	DATA_7, AL	; Moves the contents of AL into DATA_7

and here's one of the OUT command

MOV	DX, 8000H	; Initialize the address of port 0
MOV	AL, 00H		; Load data with bit 7 as logic 0
OUT	DX, AL		; Output the data to port 0

Now, I'm pretty sure these examples work in MASM, and on the Intel 8086/8088 SDK. I got them from my old Assembly book written by Avtar Singh

I'm assuming they should work because Intel just built upon the 8086 instructions to make the x86 instructions we know today. Don't quote me on it though. It's been awhile so I'm a bit unsure. It can't hurt to try it though :)

Have fun.

oRg 0 Newbie Poster

You know you can always try some video tutorials. I'm very much like you in the sense that I know a decent amount about C/C++ but I didn't know anything for MFC, Windows Forms, or anything like that.

I wanted to learn C# as well because you can do some pretty interesting things with it in XNA (formerly Managed DirectX) and I wanted to try my hands at some game programming. So I found a few tutorials online, namely just links from the MSDN.

Here's some video tutorials from www.learnvisualstudio.net
http://msdn.microsoft.com/vstudio/express/visualcsharp/learning/

For data structures and other stuff here's a nice link from the MSDN as well.
http://msdn2.microsoft.com/en-us/vcsharp/aa336800.aspx

For more info on it, I suggest just browsing through the MSDN and the MSDN forums. They are TONS of help for pretty much any .NET language.

Also, if you are associated with any university or school you should check out the MSDN Academic Alliance.

oRg 0 Newbie Poster

lol, yeah. It's a bad habit of mine that I'm trying to get out of. I understand the difference (an object is an instance of a class), but for some reason I have momentary brain farts of something. :p

oRg 0 Newbie Poster

Hi was wondering if any one knows what scripting language resource hacker uses as i would like to add a new menu to my team speek client so my clan members can open there americas army game from with in team speek also would like to know haw i could possably write a program to out put who is chating at the time on the screen any help would be much apriciated any tutorial would be great.

There is a program called TeamSpeak Overlay. It works with DirectX/DDraw/OpenGL. It's pretty easy to use. I use it whenever I play World of Warcraft.

As far as writing addons for TeamSpeak I've seen mainly just ASP.NET/Perl/CGI/PHP for use on the TeamSpeak Server.

oRg 0 Newbie Poster

the "this" keyword is a pointer to the class in which it's used. For example:

this->idNum

Is referring to the idNum data of the class your writing for.

So to answer your question, yes you would only need the "this" keyword if your working with pointers because it is essentially a pointer. It's the pointer of a class pointing to itself, if that makes any sense to you.

oRg 0 Newbie Poster

If your looking for creating threads on windows I picked up a fw cool links from doing a forum search on threads for windows.

Creatin Processes
Creating Threads
Creating Pipes
For windows mind you.

As you can see they are all linking to the MSDN, which in my very honest opinion is an EXTREMELY helpful online tool for developers working on Windows.

Also, the original thread can be found here. Just in case you needed the info for Unix.

oRg 0 Newbie Poster

Ok, I figured I'll just point you to a site and then offer my explanation as well. Here's a good link.
http://cplusplus.com/doc/tutorial/classes2.html
This link talks about the "this" keyword and static member data/functions of a class.

This "this" keyword just means "this class".

A Copy Constructor is a special kind of constructor. For example, lets say you have a simple linked list and you want to make a complete copy of it. Dynamic memory and all. Then you would need to make a copy constructor to do this. You could also do operator overloading for the '=' operator, but that's for a later discussion.

There are two types of copying. There's shallow copying where it just copies the members functions and member data and does not copy dynamic data and there's deep copying which does copy dynamic data. Here's a quick picture I whipped up in mspaint to better illustrate my point.
[IMG]http://img297.imageshack.us/img297/240/copyao2.png[/IMG]

Copy constructors are REALLY useful when you have an array of pointers pointing to some dynamic data and you want to make a copy of it for various operations and such.

Now on to inline functions. Lets say you have two functions in your program. You have int main() and you have float FindAverage(/* your parameter list */). Now let's say you want to inline FindAverage(). What inlining a function does is tell the compiler to replace all function call of FundAverage with the code inside …

oRg 0 Newbie Poster

Ok, I have figured out my problem and I'm pretty much finished except I have to add documentation to the source code. Thanks for your help guys.

oRg 0 Newbie Poster

Thanks again for your replies.

As I stated above I have fixed the problem I was originally having. I just added an extra emember function which would only read the id and nothing else.

The only thing I'm struggling with now is getting the output in the correct order.

Here's a sample of my current output:

<~~~~~~~ Grade Report ~~~~~~~>
1000 3.21 CS  **** invalid exam score

          STUDENT ID                 GPA               MAJOR
                 444                3.33                   CS
                 777                2.75                   IS
                 999                3.25                   CS
                 666                3.54                   IS

> > > end < < <

The student id entry 666 should come right after the id entry 777 and entry 999 should be last. Unfortunately as you can see this is not the case. Again I believe that it may be solved in my client-code.

oRg 0 Newbie Poster

Yeah, thats actually right. I added values for the gpa and major variables into my "in.data" file and it worked perfectly. So what I did is I made a new member function. Here's the new member function.

void ItemType::GetDeleteItemFromFile(ifstream& inFile)
// PURPOSE:
// INPUT:
// PRE:
// OUTPUT:
// POST:
// NOTE:
{
        inFile >> id;
}

I also modified my client-code just a little. Here's the modified code.

while(inFile)
        {
                if(listOperation == 'A')
                {
                        item.GetItemFromFile(inFile);
                        rdList.InsertItem(item);
                }
                else if(listOperation == 'D')
                {
                        item.GetDeleteItemFromFile(inFile);
                        rdList.DeleteItem(item);
                }
                inFile >> listOperation;
        }

However, even in this setup if my "in.data" is not modified it still messes up. So I'm just looking for a way that after reading 'D', then the id number it should go to the next line in the data file for the next read cycle.

oRg 0 Newbie Poster

Thanks for your reply. I do appreciate it.

Anyways, like I said I'm a college student and my prof. expects it done a certain way. Believe me I would rather use doubles and strings but this is how he wants it done.

I will be sure to add the couts to see where things are going awry.

Like I said, everything associated with the UnsortedType class (it's member functions and its data) are what he gave us to use. We can't modify it in anyway. I couldn't tell you why but that is what he wants. The only thing that I can modify and change are ItemType.cxx, ItemType.h, and runList.cxx. I'm pretty sure the ItemType files are right. I just think that there's a problem in my client-code (runList.cxx).

oRg 0 Newbie Poster

Hello,

I'm a college student taking a programming class and I'm trying to write a program for this class. I've done most of the work already I just need some hints or a push in the right direction as far as my client-code is concerned. Here's the code for the various .CXX and .H files. Any help is appreciated. I'm not asking for a solution just some hints.

ItemType.h

#include <iostream>
#include <fstream>
#include <iomanip>

using namespace std;

const int MAX_ITEMS = 10;
enum RelationType {LESS, EQUAL, GREATER};

class ItemType
{
public:
        RelationType ComparedTo(ItemType) const;
        void GetItemFromFile(ifstream&);
        void WriteItemToFile(ofstream&) const;
        void WriteInvalidItemToFile(ofstream&) const;
        bool invalidItem(ItemType) const;

private:
        int id;
        float gpa;
        char major[2];
};

ItemType.cxx

#include "ItemType.h"

void ItemType::GetItemFromFile(ifstream& inFile)
// PURPOSE:
// INPUT:
// PRE:
// OUTPUT:
// POST:
// NOTE:
{
        inFile >> id >> gpa >> major[0] >> major[1];
}

void ItemType::WriteItemToFile(ofstream& outFile) const
// PURPOSE:
// INPUT:
// PRE:
// OUTPUT:
// POST:
// NOTE:
{
        outFile << id << setw(20) << gpa << setw(20) << major[0] << major[1];
}

bool ItemType::invalidItem(ItemType item) const
// PURPOSE:
// INPUT:
// PRE:
// OUTPUT:
// POST:
// NOTE:
{
        return(item.id >= 111 && item.id <= 999 &&
               item.gpa >= 0.0 && gpa <= 4.0 &&
               item.major[0] == 'C' || item.major[0] == 'I' &&
               major[1] == 'S');
}

void ItemType::WriteInvalidItemToFile(ofstream& outFile) const
// PURPOSE:
// INPUT:
// PRE:
// OUTPUT:
// POST:
// NOTE:
{
        outFile << id << " " << gpa << " …
oRg 0 Newbie Poster

OMG!!!...lol. It was right there in front of my face. Thanks Dave. I just needed to insrease the size of the arrays from 2->3. Once again thanks alot Dave.

oRg 0 Newbie Poster

Hi, I'm fairly new to C++. I've taken a class on it at a university but it really only went through the basic I/O, data structures, classes, and pointers. It wasn't very algorithm oriented. It was all very basic.

Here's the problem a friend of mine needed help with his C++ homework. He is attending a different institution than myself and instead of their being 4 classes covering C++ there's only 2. Meaning his one class is the equivalent of two semesters worth of C++ at my school (which isn't saying much to me right now about my school). Though my school does offer class on A.I. and various other things such as Compiler Design, but enough about that.

His homework problem is that he's given the source for a program which he has to add a new functionality to it. This functionality is to be to parse a date input from the user of the format "mm/dd/yy". I'm familiar with everything that would be used in the process such as classes, structs, poiters etc etc. But being able to develop the algorithm is beyond me. Unfortunately I wasn't able to help him in time. Meaning he ended up not turning in the homework. But even though he got a zero for this it is still bugging me and I must find out how to do it. I know it can't use the StringTokenizer or anything along those lines except for the basic stuff. Basic libraries are onyl …

oRg 0 Newbie Poster

I use SuSE 9.1 Pro and it does everything I need it to. Though I'm not a hardcore programmer by any means and can very easily be called a n00b programmer (can't deny what I am), it still is a very user-friendly distro. With the newer version of SuSE you really don't have to worry about package dependencies becuz when installing a new package through YaST it will notify you of dependecies and such.