Pointers

Pointers are to be assigned without any * or &

So ptr=&a

& gives the address of data structure

To access the value of data structure from pointer we use *

Declare a pointer as

data_structure_to_which_pointer_will_point *name_of_pointer

http://www.tutorialspoint.com/cplusplus/cpp_null_pointers.htm

http://www.tutorialspoint.com/cplusplus/cpp_passing_pointers_to_functions.htm

http://www.tutorialspoint.com/cplusplus/cpp_array_of_pointers.htm

http://www.tutorialspoint.com/cplusplus/cpp_pointers_vs_arrays.htm

http://www.tutorialspoint.com/cplusplus/cpp_pointer_arithmatic.htm

http://www.tutorialspoint.com/cplusplus/cpp_pointer_to_pointer.htm

http://www.tutorialspoint.com/cplusplus/cpp_return_pointer_from_functions.htm

 

 

Advertisements

Polar Plot in Python

"""
Demo of a line plot on a polar axis.
"""
import numpy as np
import matplotlib.pyplot as plt


r = np.arange(0, 3.0, 0.01)
theta = 2 * np.pi * r

ax = plt.subplot(111, projection='polar')
ax.plot(theta, r, color='r', linewidth=3)
ax.set_rmax(2.0)
ax.grid(True)

ax.set_title("A line plot on a polar axis", va='bottom')
plt.show()