Search
 
SCRIPT & CODE EXAMPLE
 

C

search and then change string -- strstr and strcpy

// CPP program to illustrate strstr()
#include <string.h>
#include <stdio.h>
  
int main()
{
    // Take any two strings
    char s1[] = "Fun with STL";
    char s2[] = "STL";
    char* p;
  
    // Find first occurrence of s2 in s1
    p = strstr(s1, s2);
  
    // Prints the result
    if (p) {
        strcpy(p, "Strings");
        printf("%s", s1);
    } else
        printf("String not found
");
  
    return 0;
}
Comment

PREVIOUS NEXT
Code Example
C :: C program to Increase 1 to all of the given Integer Digit 
C :: reap zombie process in c 
C :: write varriable in file C 
C :: float and double Output 
C :: how to make play a song javascript 
C :: difference between %f and %lf 
C :: + ********************* 
C :: QDrag and Drop 
C :: dynamic stack in c 
C :: C temporary files 
C :: array in c 
C :: calculate max of three numbers using ternary operator in c 
C :: tableau c 
C :: C Variable Byte Sizes 
Dart :: how to remove debug tag in flutter 
Dart :: How to attach a FloatingActionButton to the AppBar 
Dart :: flutter format currency fcfa 
Dart :: rounded borders for container in flutte 
Dart :: delete shared preference flutter 
Dart :: flutter close app programmatically 
Dart :: flutter firestore timestamp to datetime 
Dart :: flutter check if key exists 
Dart :: how to repeatedly call a function flutter 
Dart :: flutter compare dates 
Dart :: underscore dart 
Dart :: flutter tooltip height 
Dart :: flutter audio player get duration 
Dart :: empty widget flutter 
Dart :: flutter images 
Dart :: singleton in dart 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =