Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 01:55

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Questions about C++

Discussion on Questions about C++ within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1
 
Nullable's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 390
Received Thanks: 321
Questions about C++

Hello elitepvpers members!
I have few questions about C++ and C++ integrated development environments and their comparison with C#:

List:

1. Are there any ides that contain the auto code list as most C# ides? e.g. C# - Microsoft Visual C# 2008 Express.

2. What are the main namespaces frequently used in C++? e.g in C# it is System namespace.

3. Are there any generic collections in C++? e.g C# - Dictionary<T Key, T Value>, List<T>.

4. Does C++'s definition for interfaces look like C#?

C# version :
<access modifier> interface <identifier>
{
// interface members
}

5. Socket class example in C++, if possible.

Thanks!
,Nullable
Nullable is offline  
Old 12/20/2009, 20:08   #2
 
elite*gold: 115
Join Date: Oct 2007
Posts: 9,390
Received Thanks: 12,344
1.
Not sure what you mean, but you can try the Visual C++ IDE.

2.
The C++ standard library uses namespace "std".

3.


4.
don't know

5.
ms​ is offline  
Thanks
1 User
Old 12/20/2009, 20:16   #3
 
Nullable's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 390
Received Thanks: 321
1. Works perfectly, thanks.

4. Interfaces that can be inherited/implemented by classes, in C# i would declare an interface like this:

Code:
public interface IMyCalculator
{
     int Add(int a, int b);
     int Subtract(int a, int b);
     int Multiply(int a, int b);
     int Divide(int a, int b);
}
then i would declare a class that implements it:

Code:
public class MyClass : IMyCalculator
{

      int Add(int a, int b)
       {
           return (a + b);
       }

      int Subtract(int a, int b)
       {
           return (a - b);
       }
       
       // So on with other methods.
}
Nullable is offline  
Old 12/20/2009, 20:36   #4
 
Bl@ze!'s Avatar
 
elite*gold: 240
Join Date: Dec 2006
Posts: 1,579
Received Thanks: 1,609
Well maybe u mean this:

class MyClassOne
{
public:
MyClassOne(Parameter);
private:
int add(int a, int b); // etc etc
};

and then u can use myclassone in another like that:

class MyClass: public MyClassOne
{

};
Bl@ze! is offline  
Thanks
1 User
Old 12/21/2009, 01:34   #5
 
flo8464's Avatar
 
elite*gold: 0
Join Date: Nov 2008
Posts: 161
Received Thanks: 38
Quote:
5. Socket class example in C++, if possible.
Google for "boost asio".
flo8464 is offline  
Thanks
1 User
Old 12/21/2009, 01:54   #6
 
elite*gold: 0
Join Date: Sep 2006
Posts: 248
Received Thanks: 110
Quote:
Originally Posted by flo8464 View Post
Google for "boost asio".
I wouldn't suggest boost asio for beginners, the library is widely known for its over-engineering; thus I would go for
backo is offline  
Thanks
1 User
Old 12/21/2009, 13:57   #7
 
Nullable's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 390
Received Thanks: 321
Thanks for help :}
Nullable is offline  
Old 12/21/2009, 13:58   #8
 
flo8464's Avatar
 
elite*gold: 0
Join Date: Nov 2008
Posts: 161
Received Thanks: 38
It's better to learn to use asio properly.
If you know it, you will never have to learn any other communiction protocol lib again, you can extend asio to everything.

Another pro of boost is that every part of it is a candidate for the C++ standard.
flo8464 is offline  
Old 12/21/2009, 15:45   #9
 
Nullable's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 390
Received Thanks: 321
Quote:
Originally Posted by flo8464 View Post
It's better to learn to use asio properly.
If you know it, you will never have to learn any other communiction protocol lib again, you can extend asio to everything.

Another pro of boost is that every part of it is a candidate for the C++ standard.
I am not efficient with C++ yet since i started about 2 weeks ago :} and i just wanted the Winsocket 2.0 class as a future reference
Nullable is offline  
Old 12/21/2009, 19:50   #10
 
elite*gold: 0
Join Date: Sep 2006
Posts: 248
Received Thanks: 110
Quote:
Originally Posted by flo8464 View Post
It's better to learn to use asio properly.
If you know it, you will never have to learn any other communiction protocol lib again, you can extend asio to everything.

Another pro of boost is that every part of it is a candidate for the C++ standard.
I do agree with that part, however even "Bjarne Stroustrup" has stated that Boost does sometime over engineering, and thus is not usable for beginners. Most beginners even have problems setting up the libraries, using them is even harder, especially if you come from the .NET world.
backo is offline  
Old 12/22/2009, 07:37   #11
 
Nullable's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 390
Received Thanks: 321
Quote:
Originally Posted by backo View Post
I do agree with that part, however even "Bjarne Stroustrup" has stated that Boost does sometime over engineering, and thus is not usable for beginners. Most beginners even have problems setting up the libraries, using them is even harder, especially if you come from the .NET world.
Yeah i am having a hard time with those libraries, even scope and dot operators are still confusing me .. just if C# was cross-platform ..
Nullable is offline  
Old 12/22/2009, 13:48   #12
 
flo8464's Avatar
 
elite*gold: 0
Join Date: Nov 2008
Posts: 161
Received Thanks: 38
Quote:
Originally Posted by Nullable View Post
Yeah i am having a hard time with those libraries, even scope and dot operators are still confusing me .. just if C# was cross-platform ..
Go for Python if you want a cross-platform C#.

C++ is different to C#, in positive and negative ways.
flo8464 is offline  
Old 12/22/2009, 15:20   #13
 
Nullable's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 390
Received Thanks: 321
Quote:
Originally Posted by flo8464 View Post
Go for Python if you want a cross-platform C#.

C++ is different to C#, in positive and negative ways.
I don't really like Python since i found it quite annoying when using Blender, and as far i know C++ is better than C# if advantages and disadvantages are compared, best part is that i don't have to call so **** many DLLImports :} and by the way, i can not find a good example of signals and slots ..
Nullable is offline  
Old 12/22/2009, 19:33   #14
 
elite*gold: 0
Join Date: Sep 2006
Posts: 248
Received Thanks: 110
Quote:
Originally Posted by Nullable View Post
I don't really like Python since i found it quite annoying when using Blender, and as far i know C++ is better than C# if advantages and disadvantages are compared, best part is that i don't have to call so **** many DLLImports :} and by the way, i can not find a good example of signals and slots ..
A lightweight implementation is avaible at: with a provided example; or you can check out .. get used to being redirected to boost, must have while developing in C++.. or
backo is offline  
Thanks
1 User
Reply




All times are GMT +2. The time now is 01:55.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.