#include<stdio.h> #include<stdlib.h> void read(); void send(); extern char *ptr; void main() { // char *ptr; int o; while(1) { printf("Select your option\n"); printf("1. To SEND msg\n"); printf("2. To RECIEVE msg\n"); printf("3. To EXIT\n"); scanf("%d",&o); switch(o) { case 1: { send(); //read(); }break; case 2: { read(ptr); }break; case 3: { exit(EXIT_SUCCESS); } } } }
#include<stdio.h> char *ptr; void send() { // printf("%p\n",ptr); // char *ptr; char s[50]; printf("Enter the messege\n"); scanf("%s",s); ptr = s; printf("%p\n",ptr); printf("%c",*ptr); printf("add of str %p\n",&s); // return ptr; }
#include<stdio.h> #include<string.h> char *ptr; void read() { printf("%p\n",ptr); while(*ptr != '\0') { printf("%c",*ptr++); } // char s[50]; // strcpy(s,*ptr); // printf("%s",s); }
send
read
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)