PHP- Warning: session_start(): Cannot sent session cache limiter-headers already sent, ERROR

Most of the beginners in PHP while using sessions at the first time might have encountered a long error, starting with something like,

Warning:session_start(): Cannot sent session cache limiter- headers already sent

Fix : It’s too simple!
Don’t ever leave atleast a single space before the PHP code (starting with That’s it! Don’t try to make the PHP code even a single line or space after! Let PHP begin with < itself. NOT EVEN A SINGLE SPACE before it. Also don’t print (echo) anything before the call using header function.

Difference between & and * operator in C

A beginner to Pointers in C often perplexed by different operators & and *
Let’s see what it really is and how simple it is.

& – This operator gives ‘the address of’ a variable
* – This operator gives ‘the value at address’ of a variable

(Note! Note! Note! Not the other way round! By heart it any way!)

Let’s codes speak…

#include
main()
{

	int myVariable = 25;

	printf("n Address of myVariable = %u", &myVariable);
	printf("n Value of myVariable = %u", myVariable);
	printf("n Value of myVariable = %u", *(&myVariable));
}

 

So… the output…

Guess?

Address of myVariable = 7589
//7589 is the address in memory of the variable myVariable

Value of myVariable = 25
//It simply printed the ‘myVariable’ which contains 25

Value of myVariable = 25
// Please do note that it printed ‘the value at address’ of ‘myVariable’
// Address is passed via &myVariable

:)

How to check whether GPS is available in ANDROID or Not?

This code helps you to check whether the location service is available on your ANDROID Phone or not.
Copy this code and paste to your file.
Happy coding…..

 public boolean GPSAvailable() {
     LocationManager loc_manager = (LocationManager)
     getSystemService(Context.LOCATION_SERVICE);
     List<string> str = loc_manager.getProviders(true);

     if(str.size()>0)
         return true;
     else
         return false;
}