Yes, global variables can be used to communicate information to the outside world, and to access that information from the outside world without invoking a function.

But they can lead to code that’s hard to understand and hard to maintain if due care is not taken; it is better to avoid using them whenever possible (always possible if speed is not a performance requirement.)

Here are two versions of the same program that converts angles in degrees to angles in radians.

[radian: a unit of angle, equal to an angle at the center of a circle whose arc is equal in length to the radius.]

Using three global variables:

```
// main.m
#include <math.h> // for M_PI
// format strings
const char *DEGREES = "%9.5f degrees";
const char *RADIANS = "%9.5f radians\n";
// a type name for our angles
typedef float angle_type;
angle_type _angleInRadian;
// convert the given angle to radians and put the result in the global variable
void radiansFromDegrees (angle_type degrees)
{
_angleInRadian = (M_PI/180.0)*degrees;
}
// access the angle in radians in the global variable and print
void printRadians ()
{
printf (RADIANS, _angleInRadian);
}
int main (int argc, const char * argv[])
{
for (angle_type v = 0; v <= 360; v += 15)
{
radiansFromDegrees (v);
printf (DEGREES, v);
printRadians ();
}
return 0;
}
```

There are three global variables here: DEGREES, RADIANS, and _angleInRadian. The third global variable is used to store/access the results of the computation that does the angle conversion; the first two variables are read-only global variables that specify the format strings used by printf.

Using two global variables:

```
// main.m
#include <math.h> // for M_PI
// format strings
const char *DEGREES = "%9.5f degrees";
const char *RADIANS = "%9.5f radians\n";
// a type name for our angles
typedef float angle_type;
// convert and return the result
angle_type radiansFromDegrees (angle_type degrees)
{
return (M_PI/180.0)*degrees;
}
// print the given angle in radians
void printRadians (angle_type radians)
{
printf (RADIANS, radians);
}
int main (int argc, const char * argv[])
{
for (angle_type v = 0; v <= 360; v += 15)
{
printf (DEGREES, v);
printRadians (radiansFromDegrees (v));
}
return 0;
}
```

This version no longer uses a global variable to store/access the results of the computation that does the angle conversion, but it still uses the global variables that specify the format strings.

Learning to be a good programmer is akin to learning to be a good piano player - it requires a lot of determination, a lot of practice, and a desire to explore, to make mistakes and to learn from those mistakes. (Although some people are better at this than others.) BNR books are excellent starting points to build upon. Also if you have the financial resources, they have the courses at the ranch, which you might consider attending once you feel that you have learned how to crawl. Last but not least, learning some computer science will help enormously.