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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Make virtual method in my project

Make virtual method in my project

Scheduled Pinned Locked Moved C / C++ / MFC
c++data-structureshelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nhatvhm
    wrote on last edited by
    #1

    //*****************************Main Program ****************************** #include #include #include #include "ReadWrite.h" #include "Graph.h" void main(int doiso, char *thamso[]) { GRAPH G; int rf=G.ReadData(thamso[1]); if(!rf) printf("Khong doc duoc file!\n"); else { printf("Doc duoc file!\n"); G.GraphAlgorithm(); int wf=G.WriteData(thamso[2]); if(wf) printf("Ghi file thanh cong!"); } getch(); } //******************************Graph.cpp********************************* #include #include #include "Graph.h" int GRAPH::ReadData(char *FileName) { FILE *fp=fopen(FileName,"rt"); if(!fp) return 0; fscanf(fp,"%d",&n); B=new unsigned char *[n]; unsigned char *temp=new unsigned char [n]; for(int d=0; d //***********************Graph.h************************************** `class GRAPH { private: int n; int label; int *LabelLT; unsigned char **B; public: int ReadData(char *FileName); const int WriteData(char *FileName); void GraphAlgorithm(); void Visit(int i); };` Help me, make virtual method in my project! <(-|-)> "To be or not to be"

    P T 2 Replies Last reply
    0
    • N nhatvhm

      //*****************************Main Program ****************************** #include #include #include #include "ReadWrite.h" #include "Graph.h" void main(int doiso, char *thamso[]) { GRAPH G; int rf=G.ReadData(thamso[1]); if(!rf) printf("Khong doc duoc file!\n"); else { printf("Doc duoc file!\n"); G.GraphAlgorithm(); int wf=G.WriteData(thamso[2]); if(wf) printf("Ghi file thanh cong!"); } getch(); } //******************************Graph.cpp********************************* #include #include #include "Graph.h" int GRAPH::ReadData(char *FileName) { FILE *fp=fopen(FileName,"rt"); if(!fp) return 0; fscanf(fp,"%d",&n); B=new unsigned char *[n]; unsigned char *temp=new unsigned char [n]; for(int d=0; d //***********************Graph.h************************************** `class GRAPH { private: int n; int label; int *LabelLT; unsigned char **B; public: int ReadData(char *FileName); const int WriteData(char *FileName); void GraphAlgorithm(); void Visit(int i); };` Help me, make virtual method in my project! <(-|-)> "To be or not to be"

      P Offline
      P Offline
      prasad_som
      wrote on last edited by
      #2

      I can see only one class in this code. And really dont understand your question.

      Prasad Notifier using ATL | Operator new[],delete[][^]

      1 Reply Last reply
      0
      • N nhatvhm

        //*****************************Main Program ****************************** #include #include #include #include "ReadWrite.h" #include "Graph.h" void main(int doiso, char *thamso[]) { GRAPH G; int rf=G.ReadData(thamso[1]); if(!rf) printf("Khong doc duoc file!\n"); else { printf("Doc duoc file!\n"); G.GraphAlgorithm(); int wf=G.WriteData(thamso[2]); if(wf) printf("Ghi file thanh cong!"); } getch(); } //******************************Graph.cpp********************************* #include #include #include "Graph.h" int GRAPH::ReadData(char *FileName) { FILE *fp=fopen(FileName,"rt"); if(!fp) return 0; fscanf(fp,"%d",&n); B=new unsigned char *[n]; unsigned char *temp=new unsigned char [n]; for(int d=0; d //***********************Graph.h************************************** `class GRAPH { private: int n; int label; int *LabelLT; unsigned char **B; public: int ReadData(char *FileName); const int WriteData(char *FileName); void GraphAlgorithm(); void Visit(int i); };` Help me, make virtual method in my project! <(-|-)> "To be or not to be"

        T Offline
        T Offline
        ThatsAlok
        wrote on last edited by
        #3

        what function do you want to be virtual!

        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

        cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

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