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. How to call other class functions from another class

How to call other class functions from another class

Scheduled Pinned Locked Moved C / C++ / MFC
helpdata-structuresregexjsontutorial
1 Posts 1 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.
  • O Offline
    O Offline
    olive
    wrote on last edited by
    #1

    Hi:I try to call function from other classes in here and get some problem. All the necessary include files I put already. I have the following functions that I want to call on other class. MY QUESTION IS HOW TO IMPLEMENT THESE FUNCTIONS ON OTHER CLASS... SEE MY PSEUDOCODE.... I try some of them but mostly not working. 1) istream& loser.ReadFrom(istream& in, char* format ) ; --->read from cin 2) bool Ticket::Search( int* array, int item ,int elementsInArray );--> search how many balls are matched 3) Ticket HistoryFile::GetMatch( Ticket& searchItem ); --> see if the date of cin and from the file is match the pseudocode to call those functions to other class: read from cin -->istream& loser.ReadFrom(istream& in, char* format ) see if the date match --> Ticket HistoryFile::GetMatch( Ticket& searchItem); if date on cin & date on file is same ---->if (ticket == ticket &); match how many balls are match -->bool Ticket::Search( int* array, int item ,int elementsInArray ); cout << "You match : " << ;else null ticket ---> ticket.ticket( );endifThe following is my code: void Pureluck::Run( ){ istream& loser.ReadFrom( ); --> //will give me this error Error: PURELUCK.H(92,24):Too few parameters in call to 'Ticket::ReadFrom(istream &,char *)' then if I put --> loser.ReadFrom(istream &, char * ); //---> will give me this errorError: PURELUCK.H(92,29):Improper use of typedef 'istream' all the rest of message are mostly: Expression syntax. winners.GetMatch( loser& searchItem ); //search for match date if (ticket == searchItem) // if found match { Ticket::Search( int* array, int item ,int elementsInArray )//find out how many match } else { Ticket::Ticket( ); //not found become null ticket } endif; */}//endfn RunPlease let me knowThank's

    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