Tags » Header Files

Declaration of variables in different locations in Objective-C

Having worked with Objective-C you will have noticed that there are many different locations to declare instance variables and local variables. In this article, we are going to explore the different possibilities and the meaning of each case. 373 more words

Coding

HEADER FILE HAVING AN OVERLOADED VERSION OF A FUNCTION FOR CALCULATONG A NUMBER TO THE POWER OF ANOTHER

//HEADER FILE HAVING MATHS RELATED FUNCTIONS

#ifndef _POWER_H
#define _POWER_H

float pow(float num, int power)
{
float val = 1.0;
for(int i=0; i<power; i++)
{ 24 more words

Header Files

HEADER FILE HAVING FUNCTION TO CALCULATE SUM OF DIGITS OF A NUMBER

#ifndef diksha1_H
#define diksha1_H

int sum(int num)
{
int val = 0;

while(num)
{
val += num%10;
num /= 10;
}

return val;
}

#endif

Header Files

HEADER FILE TO CALCULATE FACTORIAL OF A NUMBER

// MY HEADER FILE DIKSHA.H

#ifndef _diksha_h
#define _diksha_h

int fact(int num)
{
int val = 1;

for(; num>0; num–)
val *= num;
return val;
}

#endif

Header Files

HEADER FILE HAVING CLASS DEFINITION OF EMPLOYEE CLASS

// HEADER FILE HAVING EMPLOYEE CLASS DEFINITION

#ifndef _CLASS_H
#define _CLASS_H
#include <stdio.h>

class employee
{
char name;
int empid;
long salary;

public:
void read() 67 more words

Header Files