Course Solutions Uncategorized (Solved) : Linux Using C 1 Try Explain Error Char Y Y Hello Ok Strcpy Y Hello Error 2 Define Characte Q27757491 . . . .

(Solved) : Linux Using C 1 Try Explain Error Char Y Y Hello Ok Strcpy Y Hello Error 2 Define Characte Q27757491 . . . .

 

In Linux using by C++

1) Try below and explain why we have an error.

     char *y;

     y=”hello”; // this is ok

     strcpy(y, “hello”); // this is anerror

2) Define a character pointer array and store/display strings asbelow.

     char * x[10];

     x[0]=”hi”; x[1]=”bye”;x[2]=”hello”;

     printf(“%s %s %sn”,x[0],x[1],x[2]);

3) Read the same sentence with gets() and fgets() and explainthe difference.

      char x[100];

      printf(“enter a sentencen”);

     gets(x);                                               

      int slen=strlen(x);

      for(i=0;i<slen;i++){

         printf(“%x “,x[i]);

      }

      printf(“nenter the samesentencen”);

      fgets(x, 100, stdin);

      slen=strlen(x);

      for(i=0;i<slen;i++){

         printf(“%x “,x[i]);

      }

4) Use strtok to extract words from a sentence and store them inan array. Display the number of words as below. Use as manyfunctions

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Answered) : Evaluate Best Buy and determine why they charge different price points for the same product. Evaluate how well they represent th(Answered) : Evaluate Best Buy and determine why they charge different price points for the same product. Evaluate how well they represent th

Evaluate Best Buy and determine why they charge different price points for the same product. Evaluate how well they represent the product within their retail strategy. Research each retailer: Best Buy 1.