Advertisement
DEKTEN

TWITCH/VOLT/C_STRING/C11

May 4th, 2021
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.49 KB | None | 0 0
  1. //:Written By: www.twitch.com/kanjicoder
  2. //:       For: www.twitch.tv/v0lt13
  3.  
  4. #include <stdio.h> //:for: printf(...)
  5.  
  6.     /** **************************************************** ***
  7.     In Java or C# I think... (Don't quote me here, I write C)
  8.     String my_string=(""
  9.     +   "here is the 1st line" + "\n"
  10.     +   "here is the 2nd line" + "\n"
  11.     +   "here is the 3rd line" + "\n"
  12.     +   "here is the 4th line" + "\n"
  13.     +   "here is the 5th line" + "\n"
  14.     );;
  15.     *** ***********************************8**************** **/
  16.  
  17.      char str_001[]={
  18.         "here is the 1st line \n"
  19.         "here is the 2nd line \n"
  20.         "here is the 3rd line \n"
  21.         "here is the 4th line \n"
  22.         "here is the 5th line \n"
  23.     };
  24.  
  25.     char* str_002={
  26.         "here is the 1st line \n"
  27.         "here is the 2nd line \n"
  28.         "here is the 3rd line \n"
  29.         "here is the 4th line \n"
  30.         "here is the 5th line \n"
  31.     };
  32.  
  33.     //: Close but C# style
  34.     //: char[] = {'H', 'E' , 'L', 'L', 'O'}  
  35.     char str_003[] ={
  36.         'H', 'E' , 'L', 'L', 'O'
  37.     };
  38.  
  39.    
  40.     char arr_004[ 256 ]={0};
  41.  
  42.  
  43. int main( void ){
  44.     printf("[BEG:main]\n");
  45.    
  46.     char* str_004=&(arr_004[0]);
  47.     str_004[0]='H';
  48.     str_004[1]='E';
  49.     str_004[2]='Y';
  50.     str_004[3]=( 0 );
  51.  
  52.     printf("[str_001]%s\n" , str_001 );
  53.     printf("[str_002]%s\n" , str_002 );
  54.     printf("[str_003]%s\n" , str_003 );
  55.     printf("[str_004]%s\n" , str_004 );
  56.  
  57.    
  58.     printf("[END:main]\n");
  59. }  
  60.  
  61.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement