How do I use pointers again in C ???
can u be more specific?
I think first you create the pointer like this : struct element{ int n; struct element *next; }; typedef struct element ele; Then in your program whenever you need an instance from this pointer you just create it as follow : ele *P; //P is the name of the new pointer.
well that's the implementation of linked lists
Yep, but it uses pointers, so it's an example.
like in main for example void velocity( &&&& ) { int x; get the x and y velocity; } void printanswer ( ^^^^^ ) { } main() { CODE; } How could I point the value or address(I honestly do not have an idea for I do not understand it)from one void function to another void function? Shall I change it into a int function and type return at the end? But how? My goal is to calculate something and simply call the headers in main. like main() { velocity(); printanswer(); } Also where should I put the *x, or the x or the &x? And how should I use them? I am really quite confused. MEDALS will be awarded for the best answerS that I will get. xD
#include <stdio.h> int main(void) { char ch = 'c'; char *chptr = &ch; int i = 20; int *intptr = &i; float f = 1.20000; float *fptr = &f; char *ptr = "I am a string"; printf("\n [%c], [%d], [%f], [%c], [%s]\n", *chptr, *intptr, *fptr, *ptr, ptr); return 0; }
Join our real-time social learning platform and learn together with your friends!