Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Novice C++ Programmers post here!

Options
  • 14-10-2001 9:44pm
    #1
    Registered Users Posts: 455 ✭✭


    I'm looking to just get a network of email contacts who are also beginning to learn C++... myself I've only learned a few commands so far but I'm hoping to actually get good at the language some day :) Right now I'm working on a basic DOS text-based role playing game...

    As for the email network idea, it would just be cool to be in contact with other beginners so that we can discuss ideas and help each other out. :)


Comments

  • Registered Users Posts: 935 ✭✭✭Mixie


    New to C++ myself, feel free to mail me mixie(at)barrysworld.com


  • Registered Users Posts: 1,842 ✭✭✭phaxx


    Me too, learning vc++, what with all the fancy MFC and all that. I intend to play with GDI, possibly directdraw/etc and maybe basic opengl, which would be very nifty indeed.

    I was send a pdf version of sams' teach yourself c++ in 21 days, which seems good. It's 5mb, I'll upload it somewhere now and post a link.


  • Registered Users Posts: 455 ✭✭Lyconix


    Originally posted by phaxx
    I was send a pdf version of sams' teach yourself c++ in 21 days, which seems good. It's 5mb, I'll upload it somewhere now and post a link.

    Sounds great :)


  • Registered Users Posts: 935 ✭✭✭Mixie


    Thanks Phaxx :)

    Cost me ~ £100 for a set of sams books for VB, wasn't worth it in the end lol.


  • Registered Users Posts: 1,028 ✭✭✭Hellm0


    You might say I am learning,but at a snails pace.Books do little for me,Whatever I read,its not very consistent
    Hellm0@solarshadow.com

    [IMG]http://solarshadow.com/hellmo copy.jpg[/IMG]


  • Advertisement
  • Registered Users Posts: 455 ✭✭Lyconix


    Try www.cplusplus.com, they have a tutorial that can get you started :)


  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    I haven't started doing C++ yet, but seriously intend to. I already know Java, so it's just about learning syntax and classes.

    I recommend, starting up a yahoogroups email thingy. You just put everyone's email into this group, and then anyone with some good links or suggestions, just sends an email to the group email, e.g. Cprogramming_eire@yahoogroups.com or something like that, and everyone in the group gets that email. Saves having to keep a load of emails, and no-one (except yahoo) know your email anyway.


  • Closed Accounts Posts: 5,564 ✭✭✭Typedef


    hmmmm, I guess I should probably bite right?
    cout@eircom.net

    hey what do you lot think of this?
    
    class netfile{
    		public:
    		char filename[1024];
    		char hostname[1024];
    		char hostpath[1024];
    		char url[3072];
    		int  content_len;
    		int  content_written;
    		int  skfd;
    		void parse_resumefile();
    		void write_resumefile();
    		void go_download();
    		virtual void parse_header(void);
    		virtual void make_connect(void);
    		void equate(netfile & n);
    		};
    #endif
    ////////////////////////////////////////////////////////////////////////////////////////
    #ifndef FTP_H
    #define FTP_H
    #include "base.hpp"
    
    class ftp:public netfile
    	{
    		public:
    		virtual void parse_header(void);
    		virtual void make_connect(void);
    	};
    #endif
    ///////////////////////////////////////////////////////////////////////////////////////
    #ifndef HTTP
    #define HTTP
    #include "base.hpp"
    
    class http:public netfile
    	{
    	 public:
    	 virtual void parse_header(void);
    	 virtual void make_connect(void);
    	};
    	
    #endif
    ///////////////////////////////////////////////////////////////////////////////////////////
    #ifndef POLYCALL
    #define POLYCALL
    #include "ftp.hpp"
    #include "http.hpp"
    
    void poly_parse_header(netfile & ob);
    void poly_make_connect(netfile & ob);
    
    #endif
    //////////////////////////////////////////////////////////////////////////////////////
    #ifndef AGFILE
    #define AGFILE
    #include "polycall.hpp"
    
    class agfile:virtual public ftp,virtual public http
    	{
    		public:
    			agfile get_type();
    			bool ftp_t;
    			bool http_t;
    			agfile()
    			{
    				ftp_t=false;
    				http_t=false;
    			};
    			void function_caller(void somefn(netfile &));
    			//void equate(netfile & n);
    			//void re_equate(netfile & n);
    	};
    #endif	
    //////////////////////////////////////////////////////////////////////////////////
    #include "agfile.hpp"
    
    int main(int argc,char**argv)
    {
     agfile o;
     cout<<"Please enter url now : ";
     cin>>o.netfile::url;
     o.get_type();
     o.function_caller(&poly_parse_header);
     cout<<o.netfile::url<<" "<<o.netfile::hostname<<" "<<o.netfile::hostpath<<endl;
     o.function_caller(&poly_make_connect);
    return 0;
    };
    ///////////////////////////////////////////////////////////////////////////////////////////
    void agfile::function_caller(void somefn(netfile &))
    {
    	ftp f;
    	http h;
    	
    	if((*this).ftp_t==true)
    	{   (*this).netfile::equate(f);
    		somefn(f);
    		f.netfile::equate((*this));
    	}
    	else if((*this).http_t==true)
    	{   (*this).netfile::equate(h);
    		somefn(h);
    		h.netfile::equate((*this));
    	}
    	else{cout<<"Error : can't determine netfile-aggregate file-type"<<endl;};
    	
    return;
    };
    //////////////////////////////////////////////////////////////////////////////////////////////////
    void netfile::equate(netfile & n)
    {
    	        strcpy(n.filename,(*this).netfile::filename);
    		strcpy(n.hostname,(*this).netfile::hostname);
    		strcpy(n.hostpath,(*this).netfile::hostpath);
    		strcpy(n.url,(*this).netfile::url);
    		n.content_len=(*this).netfile::content_len;
    		n.content_written=(*this).netfile::content_written;
    		n.skfd=(*this).netfile::skfd;
    		cout<<"equate"<<(*this).netfile::hostname<<endl;
    		cout<<"equate"<<n.netfile::hostname<<endl;
    return;
    };
    

    hmmm?


  • Registered Users Posts: 455 ✭✭Lyconix


    That code is above and beyond my current C++ coding level :) What is it?


  • Registered Users Posts: 935 ✭✭✭Mixie


    think I'm in over my head ;)


  • Advertisement
  • Registered Users Posts: 1,842 ✭✭✭phaxx


    http://sleepygeek.org/stuff/tysvc.pdf (~5mb)

    Sams Teach Yourself Visual C++ in 21 Days in PDF format.


  • Closed Accounts Posts: 5,564 ✭✭✭Typedef


    The point is right?

    If netfile is the base and every derived class is a type of netfile then I "could" inherit indefinite classes without the top level execution chaning see?

    So say we want to add protocol W - but we have written a whole application around the other classes, what do we do? Well if all of the objects passed to our caller_function are of the same base type then why can't we polymorphically call them @ run time and thus add a class type to aggfile so that as far as all other aspects of the application are concerned we are calling a netfile.some_fn ok? Ergo every function we call is of base class type see? So that we can add madly different types to aggfile but call the appropiate object.parse_header say, ok?

    Hmmm I think I might have heard a purist say once that if a language does not support polymorphism then the language is object based, not object oriented, and thus the crux of object orientation was polymorphism, hmmm I might even agree?


  • Registered Users Posts: 11,979 ✭✭✭✭Giblet


    looks like some kinda download client


  • Closed Accounts Posts: 5,564 ✭✭✭Typedef


    gtklex.sourceforge.net


  • Registered Users Posts: 455 ✭✭Lyconix


    Whoops, forgot that I wasn't subscribed to this thread... that would explain the long time it took to post here, sorry all :)

    Thanks for the link Phaxx, and by the way Typedef, you don't seem like much of a C++ beginner ;)


  • Closed Accounts Posts: 5,564 ✭✭✭Typedef


    hmmm
    can i be on the mailing list anyway?


  • Registered Users Posts: 16,413 ✭✭✭✭Trojan




  • Registered Users Posts: 455 ✭✭Lyconix


    lol :) Ever had a shot at making a game Typedef?

    I'm actually trying to make a text-based RPG with my miniscule C++ knowledge, so you had better say Yes!


  • Closed Accounts Posts: 5,564 ✭✭✭Typedef


    sniff.
    RPG, hrrmm well s'pose it might be worth a try.
    tho
    Trojan may be better one to ask with his
    Unix systems programming experience/?

    Oh and Trojan
    I Know where you work
    I Know where you live
    I mean how may animated dogs wearing glasses are there in Mayo?


  • Registered Users Posts: 455 ✭✭Lyconix


    You'd be surprised, a lot of the poochies in Mayo have impaired sight!


  • Advertisement
Advertisement