Friend Class and Inheritance [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Improve this question
I have a friend class B of my class A,
Is it possible that B's ancesstor can also access A's functionality or this friendship is only between A and B strictly

No, friendship is not inherited. In future I suggest you try such things out before posting a question.

Related

Base class variables were `not declared in its scope` [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Improve this question
I am trying to go through C++ inheritance and I have a problem with my code. I have the base class Caine and CaineCuPete derived from it. I get an error when I declare the derived class constructor.
CaineCuPete(int nPete) : Caine(cNume,cHeight,cWeight,cAge,cColor);
Error:
cNume was not declared in its scope. cHeight was not declared in its
scope. ...
You need to take these as input parameters in your derived class constructor.
CaineCuPete(int nPete, string cNume, double cHeight,
double cWeight, double cAge, int cColor ) : Caine(cNume,cHeight,cWeight,cAge,cColor),
Pete ( nPete )
{
}
This link explains:
http://www.learncpp.com/cpp-tutorial/114-constructors-and-initialization-of-derived-classes/
You should define your variables cNume,cHeight,cWeight,cAge,cColor before the first use. A common problem is that they are defined after the point of use, not before.

Storing Objective-C class instance in C++ class [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Is there a way to store an Objective-C class instance inside of a C++ class as a member?
You need to make a .mm file, and then you can use the features outlined here. See also a reference to Apple's old documentation on the hybrid language.

In Perl - How to normalize Path for windows [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I am new in Perl, but i need to know how to get variable contain specific path normalized for windows.
Thanks,
MaMd0u7
http://perldoc.perl.org/File/Spec.html
use File::Spec::Win32
my $dir = File::Spec::Win32->catfile('directory','tree','file.html');
print $dir;
output: directory\tree\file.html
any use?

What does a single colon introduce as part of a constructor? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
This is from a CPP Source File:
class classname{
//constructor
classname(anotherclass *ptr);
private:
string firstname;
string lastname;
};
classname::classname(anotherclass *ptr): firstname("Nathan"), lastname("Narcovy"){
//some other definitions
}
I come from C, but I do know a bit of Object Oriented Language,
But I don't understand classname:string,string . I only remember a colon : was used for inheritance.
This is actually how the initializer list works for constructor.
I've found this tutorial which seems to explain it decently for newcomer.

How drop packet with libiptc in c++? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
Is there a way to drop packets with libiptc c++?,i want a sample code for drop packet with libiptc in c++.
for this you should write a driver.
for example you can use main_hook function.