#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() { ...
-
//See sabse pehle ek khali node bana lena jiska prev and next null ho uske bad use return kar le fir saare operation perform kar lena //Tim...
-
#include<stdio.h> #include<stdlib.h> struct node { int data; struct node* next; }; void inElFr(struct node** head, int ...
-
#include<stdio.h> int main() { int arr[5] = {44, 33, 55, 22, 11}; int temp; for(int i = 0; i<=4; i++) { f...
No comments:
Post a Comment