Thanks a lot everyone. :)
Type: Posts; User: Prateek Sarkar
Thanks a lot everyone. :)
Why exactly do we need double pointers as arguments here? Can't the same be achieved without it? Eg. instead of what you suggested,
node * head = &ptr;
head== ptr;
works the same way, or...
What does a *node_name hold? Since a node is a structure of multiple data types, what does *node_name fetch? I know int *c, *c would fetch the integer stored at address pointed to by c.
Thank YOU. :)
Here is a basic program for insertion at the beginning of a LL.
void insert( node **head, int item)
{
node *ptr;
ptr=(node *) malloc(sizeof(node));
ptr->info= item;
if( *head == NULL)...
size_t here is an user-defined return type I believe. How do we implement it? Can you help me with an example? Thanks.
How can we assign a pointer to a function? const char* function_name(), here what exactly does the pointer point to?
Thanks.
Oh my. I missed that completely. Thanks a lot.
Why do we not pass the address of the string during printf or scanf functions like we do for Integer or float variable types?
Thanks in advance.
Thanks a lot :)
Thanks have got a pretty good picture of what you have explained so far. But what I still don't get is why do you say j is pointing to an 'ARRAY' of characters? j= (char*)&a typecasts the pointer to...
Can you kindly elaborate a little? As to how exactly does this happen?
What if I had used %c instead?
I am clear with the first part. But correct me please, the *j points to the starting address of the array which holds a floating value 3.14. Why does it print the ASCII value?
Eg. int *p, a = 10; ...
#include<stdio.h> int main() { float a=3.14; char *j; j = (char*)&a; printf("%d\n", *j); return 0; }
Forgive my ignorance, but what is the significance of the statement
j=...
Okay my doubts are cleared for now. Thanks a lot C99 :)
Yeah, I wrote down the wrong for loop. Sorry.
So, for the above piece of code, the condition ( s[i] != c) compares the numeric value corresponding to the character at s[i] to the integer value c....
I don't get by what you mean by ' not allowed to change its contents'. *arr can be used to assign to another string right since neither the pointer nor the string has been declared as a constant....
Here is a piece of code which am struggling to comprehend,
void squeeze ( char s[], int c)
{
int i, j;
for ( i=0; j=0; s[i] != '\0'; i++)
if (s[i] != c)
s[j++]...
So when I use an array of pointers, the *arr points to the string( no numeric values and the string is stored as it is in memory) whereas when I don't use it the numeric value of 'S' gets stored in...
Hello,
I am confused as to how a character array gets stored. Eg. char arr = "string", how does it get stored in memory?
Also, what if I intend to perform some arithmetic operations on a...