An array name is a pointer, so using arrays as pointers in function calls is implicit. An example is...
char a[] = "This is the source";
char b[sizeof(a)];
strcpy (b, a);
This is exactly the same1 as saying...
char a[] = "This is the source";
char b[sizeof(a)];
strcpy (&b[0], &a[0]);
... or ...
char* ap = "This is the source";
char* bp = malloc(strlen (ap)+1);
if (bp == NULL) { ... handle memory exception ... }
strcpy (bp, ap);
---------------------------------------------------------------------------------------------
1However, while a and ap have the same value in these examples, they are not really the same. You can assign a new value to ap, but not to a, because a is an r-value that is not allocated a place in memory, as opposed to ap, which is a l-value. To reinforce this, both *ap and a[0] are l-values, meaning the same thing, but not quite so for ap and a. Be careful - they both have the same value, but ap is an assignable l-value, while a is a un-assignable r-value.
This is not a question.
If you don't need to preserve the first string you could just iterate over the second string and copy each character onto the end of the first string, then return that
explain about function call
Use "+". Example: String string = "does this answer " + "your question?";
i dont no string for servlate
program to find maximum of two numbers using pointers
This is not a question.
performing string operation using pointers
Sure, you can write a function in C to convert a string to Pig Latin without using pointers by passing the string as a parameter and manipulating it directly within the function. You can split the string into words, check if a word starts with a vowel or consonant, and then apply the appropriate transformation following the rules of Pig Latin. Remember to allocate enough memory for the modified string to prevent buffer overflow.
Use text-editor notepad++
If you don't need to preserve the first string you could just iterate over the second string and copy each character onto the end of the first string, then return that
shashi
sorry
nahi malum
There are many uses of pointer in C. Pointers are efficient and elegant to use. All string variables are pointers, and calling a function using a pointer allows the function to change the value globally. These are what you can do with pointers in C. 1) Returning multiple values by passing address of variables. eg. foo(&a,&b,&c); 2) When you want to modify the value passed to function. eg. scanf() function. int n; scanf("%d",&n); /* pass address of variable n so that scanf can change its value*/ 3) When you need to pass large data structure to function, it is more efficient to pass pointer to structure than passing the entire structure. If you don't want to modify the structure members, you can use 'const' keyword which the ANSI-complaint C compiler will either warn or give error if you modify. eg strlen(const char *str) in string library should not modify the content of str. 4) Implementing 'goto' data structures are easy with pointers. eg. linked-list,binary trees, hash table. 5) You can allocate dynamic memory using pointers. 6) Pointers to function are used for call back function and jump table. eg qsort() and bsearch() functions require the caller to provide pointer to function to do the comparison.
Without any function is impossible. So I'll assume you mean any coded function, in which case the predefined function below is your answer.$string = strrev($string);
explain about function call