I didn't quite follow the lecture; maybe someone can help me. This is regarding Week 7's "Lecture, continued," about 12 minutes in, when Prof. Malan is going over the simple implementation of a search function.
In the header file, he has defined the struct as containing int n:
typedef struct node
{
int n;
struct node* next;
}
node;
Later, in the search function for the main program, he has asked the user for an integer to search for, and declares int n as GetInt().
int n - GetInt();
I am confused as to why these are both called n. As a result, the line of the search function
if (ptr->n ==n)
contains the letter n in two places, but aren't these two n's two different things? (If they're not, then I'm even MORE confused.) Why are they both n? He said this is "a common paradigm," so is it common to call the data in your node n and then also call the thing you are searching for n?