Programming Tactics
Share knowledge
Friday, October 7, 2011
Thursday, September 1, 2011
Official Google Blog: Android in spaaaace! (Part 2)
Official Google Blog: Android in spaaaace! (Part 2): Back in December, Android ventured into near space , thanks to a weekend of DIY work, a couple of Nexus S phones, some weather balloons and ...
Friday, March 18, 2011
Function & its Declaration
The typical way of something done in C++ programs is to
call a function.Defining a function is the way you specify how
an operation is to be done.Whenever a function is defined must
specify a return type to indicate the type of the value returned by
the function when it complete its task.A function cannot be called
unless it has been declared.
Function declaration gives the name of the function,the type
of value returned (if any) by the function and the number of function,
types of arguments must be supplied in a 'call' of the function.
Each function in a program performs a task and may return a value.
call a function.Defining a function is the way you specify how
an operation is to be done.Whenever a function is defined must
specify a return type to indicate the type of the value returned by
the function when it complete its task.A function cannot be called
unless it has been declared.
Function declaration gives the name of the function,the type
of value returned (if any) by the function and the number of function,
types of arguments must be supplied in a 'call' of the function.
Each function in a program performs a task and may return a value.
Monday, February 7, 2011
Friend Function & class
FRIEND FUNCTIONS
If we want to declare an external function as a friend of class
thus allowing this function to have access to the private and protected
members of this class,we do it by declaring a prototype of this external
functions within the class and preceding it with keyword 'friend'.
For example, we could define an operator that multiplies a Matrix by a Vector . Naturally,
reference(bjaurne.S book)
FRIEND CLASS
we can define a class as friend of another class,by granting
that first class access to the protected and private members of
the second one.
If we want to declare an external function as a friend of class
thus allowing this function to have access to the private and protected
members of this class,we do it by declaring a prototype of this external
functions within the class and preceding it with keyword 'friend'.
For example, we could define an operator that multiplies a Matrix by a Vector . Naturally,
Vector and Matrix each hide their representation and provide a complete set of operations for
manipulating objects of their type. However, our multiplication routine cannot be a member of
both. Also, we don’t really want to provide lowlevel
access functions to allow every user to both
read and write the complete representation of both Matrix and Vector .
To avoid this, we declare the operator a friend of both:
c l a s s M a t r i x ;
c l a s s V e c t o r
{
f l o a t v [4 ];
f r i e n d V e c t o r o p e r a t o r *(c o n s t M a t r i x &, c o n s t V e c t o r &);
};
c l a s s M a t r i x
{
V e c t o r v
f r i e n d V e c t o r o p e r a t o r
};
reference(bjaurne.S book)
FRIEND CLASS
we can define a class as friend of another class,by granting
that first class access to the protected and private members of
the second one.
Saturday, February 5, 2011
Deploy using a Setup and Deployment Project
Procedures for deploying Visual C++ library DLLs as shared assemblies
Create a Setup and Deployment Project
- From the File menu, click New Project, open the Other Project Types node and select Setup and Deployment, then click Setup Project give a name and press OK.
- Add the EXE and DLL to the project and specify where they should be installed on the target computer
- From the Project menu, choose Add and click File.
- Find the folder containing MyApplication.exe and MyLibrary.DLL and select them both.
- In the File System window, right click on Application Folder, point to Add and click Create to create a new folder and name it.
- Build setup.exe
Run setup.exe
- Your application is installed in the specified target folder.
Monday, January 24, 2011
Constructor Overloading
Constructor overloading is
a method with one name and perform
variety of task.
a method with one name and perform
variety of task.
Constructor
Constructor is a method which create and intialize objects.
They dont return values,constructor can be default constructor.
It just initialize members and object.Constructor is of same name
as of 'Class'.
Class employee
{
private:
int age;
char name;
public:
age 1();
name 1();
}
employee : age 1()
{
cout<<"enter age";
cin>>age;
}
main()
{
employee e= new employee();
e.age 1();
cout<<"age";
}
where 'e' is the object and 'new' for memory allocation,
we declare object and access everything through it.Default
constructor to called class employee.
They dont return values,constructor can be default constructor.
It just initialize members and object.Constructor is of same name
as of 'Class'.
Class employee
{
private:
int age;
char name;
public:
age 1();
name 1();
}
employee : age 1()
{
cout<<"enter age";
cin>>age;
}
main()
{
employee e= new employee();
e.age 1();
cout<<"age";
}
where 'e' is the object and 'new' for memory allocation,
we declare object and access everything through it.Default
constructor to called class employee.
Subscribe to:
Posts (Atom)