#include<stdio.h>
void fncpy(char* str2, char* str1) {
int i = 0;
while(*str1 != '\0') {
str2[i] = *str1;
i++;
str1++;
}
*str1 = '\n'; //Isse lagana padega qki compiler khud ye copy nahi kareaga
printf("Content from str2 to str1 is %s", str2);
}
int main() {
char str1[5] = "atul";
char str2[5];
fncpy(str2, str1);
return 0;
}
Monday, November 29, 2021
StrCpy Implementation
Subscribe to:
Post Comments (Atom)
Priority queue deleting elements after ascending inputs Gaand Fadd
using namespace std; #include<iostream> #define N 5 class pq { public: int* arr; int front; int rear; pq() { ...
-
using namespace std; #include<stdio.h> #define N 5 class q{ public: int* arr; int front; int rear; q() { ...
-
#include<stdio.h> int fnCmp(char* str1, char* str2) { while( (*str1 != '\0' && *str2 != '\0') && ...
-
#include<stdio.h> void fncpy(char* str2, char* str1) { int i = 0; while(*str1 != '\0') { str2[i] = *str1; ...
No comments:
Post a Comment