What is the difference between char a[] = "string"; and
char *p = "string"; ?

Answer Posted / singamsa

we can not access a++ or a-- on array but we can do that in
pointers

array, address is constanct for that string, pointer is not
like that

Is This Answer Correct ?    43 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is register variable in c language?

590


What is a pointer and how it is initialized?

594


the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....

22164


What is a structure and why it is used?

609


Explain what are multibyte characters?

613






stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.

1838


Are c and c++ the same?

620


how to capitalise first letter of each word in a given string?

1421


Can you please explain the difference between syntax vs logical error?

682


In a byte, what is the maximum decimal number that you can accommodate?

614


What are two dimensional arrays alternatively called as?

649


Write a C program linear.c that creates a sequence of processes with a given length. By sequence it is meant that each created process has exactly one child. Let's look at some example outputs for the program. Here the entire process sequence consists of process 18181: Sara@dell:~/OSSS$ ./linear 1 Creating process sequence of length 1. 18181 begins the sequence. An example for a sequence of length three: Sara@dell:~/OSSS$ ./linear 3 Creating process sequence of length 3. 18233 begins the sequence. 18234 is child of 18233 18235 is child of 18234 ........ this is coad .... BUt i could not compleate it .....:( #include #include #include #include int main(int argc, char *argv[]) { int N; pid_t pid; int cont; if (argc != 2) { printf("Wrong number of command-line parameters!\n"); return 1; } N = atoi(argv[1]); printf("Creating process sequence of length %d.\n",N); printf("%d begins the sequence.\n",getpid()); /* What I have to do next ?????? */ }

1610


Explain how can I manipulate strings of multibyte characters?

769


Explain how do you list a file’s date and time?

611


What is the size of enum in bytes?

574