• 0

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191


File: /var/www/html/cnasolution/application/views/question.php
Line: 191
Function: _error_handler

File: /var/www/html/cnasolution/application/controllers/Questions.php
Line: 419
Function: view

File: /var/www/html/cnasolution/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

The String Concatenation In C

I read a article from https://blog.holbertonschool.com/code-review-string-concatenation-in-c/ which show the concatenation of two char arrays in c (64-bit,linux),then I got the problems:

  1. I run the code in windows,but got another result
  2. when the code '*a = *b' was run,the address between a and b are not same
  3. in the second while loop,the code only run twice and the b pointer was '' and exist the loop

Here is the code :

#include  int main(void) {   char aa[] = "Studytonight ";   char bb[] = "- Bestplace to learn";   char *a;   char *b;   printf("aa [%s]
", aa);   printf("bb [%s]
", bb);   a = aa;   b = bb;    while (*a)   {     a++;   }   while (*b)   {     *a = *b;     b++;     a++;   }   *a = '';   printf("The string after concatenation is: %s
", aa);   printf("bb is now [%s]
", bb);   system("pause");   return (0); } 
Download script demo [LINK]
Download script demo [LINK 2] Download script demo [LINK 2]