Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
X

Xds

@Xds
About
Posts
3
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Using Visual C++ 6 to create DOS applications
    X Xds

    Hello all, I own Microsoft Visual C++ 6 Pro, and have been using it for some time. I've created "Win32 Console Applications" but am interested in using the VC++ dev env to create true MSDOS programs. Speciafically, I'm creating a DOS program that is going to access the serial port. What's the best way to go about this? I've tried #include'ing but it doesn't seem to be the full featured library that is included with other DOS based compilers. Specifically, it's missing things like textcolor() and gotoxy(). Thanks for your help! Xds

    C / C++ / MFC c++ help question

  • Help with multiple classes
    X Xds

    Pretty sure it works either way, but in any case, that's not the problem. Thanks! Mike

    C / C++ / MFC c++ question help

  • Help with multiple classes
    X Xds

    Hi all, This is my first post; I'm new to C++ so go easy on me. I have two classes; and their functions include code that refer to the other: i.e: Class X has code that uses a variable/function from Class Y and vice-versa. The classes are completely different, so it would not help to derive one off the other. In Header.h:

    ------------------------------------------------------------
    class X {
    public:
    int myint;
    void doit(void);
    };

    void X::doit(void) {
    printf("CY.myint = %i", CY.myint); // Print Class Y's myint
    }

    class Y {
    public:
    int myint;
    void doit(void);
    };

    void Y::doit(void) {
    printf("CX.myint = %i", CX.myint); // Print Class X's myint
    }

    In Main.CPP:

    ------------------------------------------------------------
    #include "stdio.h"
    #include "Header.h"

    int main(void) {

    class X CX;
    class Y CY;
    
    CX.myint = 100;
    CY.myint = 200;
    CX.doit();
    CY.doit();
    
    return 1;
    

    }

    How can I get these classes to work together? I can't put an 'extern class Y' before the 'class X' declaration, so how can I let the compiler know that the other class exists and will be declared? Thanks! Mike

    C / C++ / MFC c++ question help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups