Thread: ne shortcut guys?

  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    6

    ne shortcut guys?

    Hi;


    It's me agan , hey people is there ne way i can copy paste a code fromm c++ to word or something rather than everytime rewrite the complete code on the site , it tried saving it on a floppy\drive as a zip file and a .cpp file and have attached it ,just tell me if it works ,and in this code m gettin errors, 4 of them, also tell me how to rectify it.
    Last edited by vyaskartik2001; 03-02-2004 at 01:29 AM.

  2. #2
    Registered User manofsteel972's Avatar
    Join Date
    Mar 2004
    Posts
    317

    Not sure what your having problems with

    The only think i found wrong with the class is that you don't have a final brace at the end with a semicoln and your missing semicoln's after the functions in the function show()

  3. #3
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    it should look more like this:
    Code:
    /* DATE.H */
    
    #include<iostream>
    
    using std::cout;
    using std::endl;
    
    #ifndef _DATE_H
    #define _DATE_H
    
    class date
    {
        private:
            int day;
            int month;
            int year;
        public:
            void set(int dayin,int monthin,int yearin);
            void show();
    };
    
    #endif
    
    void date::set(int dayin,int monthin,int yearin)
    {
        day=dayin;
        month=monthin;
        year=yearin;
    }
    void date::show()
    {
        cout<<day<<"-"<<month<<"-"<<year<<endl;
    }
    Code:
    /* MAIN.CPP */
    
    #include "class.h"
    
    int main(int argc,char**argv)
    {
        date d1,d2,d3;
    
        d1.set(56,56,1894);
        d1.show();
    
        ...
        return EXIT_SUCCESS;
    }
    Last edited by major_small; 03-02-2004 at 10:22 AM.
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  4. #4
    Registered User
    Join Date
    Nov 2003
    Posts
    6
    thanx for the answer guys , well i have added all the braces and semicolon ,but still m gettin the error , i copied major_small's code thanx for tht dude ,hey can u tell me how did u became seniour member ,i don't get tht option in my profile!

  5. #5
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    it just happens after a few posts... just stay around and it'll happen... then once you do, you can change 'senior member' to anything you want...

    a little more code (if you want to output more stuff like you were trying):
    Code:
    /* DATE.H */
    #include<cstring>
    #include<iostream>
    ...
    void date::set(int inday,int inmonth,int inyear,char*inmessage)
    {
        day=inday;
        month=inmonth;
        year=inyear;
        strcpy(message,inmessage);
    }    
    void date::show()
    {
        cout<<message<<endl;
        cout<<day<<"-"<<month<<"-"<<year<<endl;
    }
    Code:
    /* MAIN.CPP */
    ...
    d1.set(12,34,5678,"First Person:");
    ...
    Code:
    /* output: */
    First Person:
    12-34-5678
    copying the code is fine, just try to make sure you actually understand what's going on...
    Last edited by major_small; 03-02-2004 at 11:03 AM.
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  6. #6
    Been here, done that.
    Join Date
    May 2003
    Posts
    1,164

    Re: ne shortcut guys?

    Originally posted by vyaskartik2001
    Hi;
    It's me agan , hey people is there ne way i can copy paste a code fromm c++ to word or something rather than everytime rewrite the complete code on the site ...
    Yes. Highlight (select) the portion of code you want, Ctrl-C to copy to the clipboard.

    Add code tags to your message, place the cursor between and press Ctrl-V to paste the code.
    Definition: Politics -- Latin, from
    poly meaning many and
    tics meaning blood sucking parasites
    -- Tom Smothers

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. disable windows shortcut keys
    By Micko in forum Tech Board
    Replies: 2
    Last Post: 12-07-2005, 08:07 AM
  2. shortcut problem
    By Micko in forum Tech Board
    Replies: 3
    Last Post: 09-17-2004, 03:01 PM
  3. Hey guys, I'm new!
    By MrDoomMaster in forum C++ Programming
    Replies: 15
    Last Post: 10-31-2003, 05:47 PM
  4. How long have you guys been working with C/C++??
    By Lurker in forum A Brief History of Cprogramming.com
    Replies: 24
    Last Post: 08-01-2003, 03:41 PM
  5. hello guys
    By lupi in forum C++ Programming
    Replies: 1
    Last Post: 09-09-2001, 01:00 AM