Friend non member function can access private member variable also. following example help you to understand how to use friend keyword and how to access member private variables from non member function.
#include <stdio.h>
class Woman{
//making it friend
friend void loveWoman();
private:
int age;
int salary;
public:
char name[50];
void walk();
};
//friend function
void loveWoman(){
...
Tuesday, May 29, 2012
Sunday, May 27, 2012
SQL Server Tips
Posted on Sunday, May 27, 2012 by nayana
1. How to get list of stored procedures in a database
SELECT NAME FROM SYS.ALL_OBJECTS WHERE type= 'P'
2. How to get list of tables in a database
SELECT * from sysobjects where type = 'U'
3. How to get list of databases in a SQL server
SELECT name, collation_name
FROM sys.databases
WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb')...
Categories: Database, SQL Server
Wednesday, May 23, 2012
How to convert integer number to a binary string in C++.
Posted on Wednesday, May 23, 2012 by nayana
Converting integer to binary string is a very simple matter. for this there is a special class call "bitset".
so fallow the example bellow and try to play around "bitset"
For more information visit http://www.cplusplus.com/reference/stl/bitset/
#include <iostream>
#include <bitset>
void main(){
//creating instance using bitset (16 bit). here you can specify the length suc as ...
Categories: CPlusPlus
Subscribe to:
Posts (Atom)