How to replace a character at a specific index in a string with C

1 Answer

0 votes
#include <stdio.h>

int main() 
{                       
    char s[] = "c programming"; 
   
	s[2] = 'G';
    puts(s);
    
    return 0; 
} 
 
 
 
/*
run:
 
c Grogramming

*/

 



answered Nov 12, 2019 by avibootz
...