2 Software and Hardware Requirements 3 Technical Details
2 Software and Hardware Requirements 3 Technical Details
2 Software and Hardware Requirements 3 Technical Details
1 INTRODUCTION............................................................................................................ 1
3.1 Stack................................................................................................................................... 4
3.4 Modules.............................................................................................................................. 7
4 RESULTS ........................................................................................................................... 27
5 CONCLUSION .................................................................................................................. 36
6 BIBILOGRAPHY .............................................................................................................. 37
iii
LIST OF FIGURES
iv
CHAPTER-1
1 INTRODUCTION
Real time chat is virtually any online communication that provides a real
time or live transmission of text messages from sender to receiver. It’s
lightweight to use the terminal for our chat, as there is no opening of the
browser, loading of JS libraries or any frontend code. Also, it allows us to
quickly test our ideas without worrying about what the user interface would
look like.
1) Admin panel :-
Admin has the authority to search and view the record of all the users.
2) Users :-
User has to sign in with his name and mobile number then user will be
allotted so that user can send to others and receive messages from others.
1
CHAPTER-2
• Front-End : Turbo c
2
CHAPTER-3
3 TECHNICAL DETAILS
• Easy to learn
• Structured language
3
In this application we are using stack, queues and doubly linked list.
3.1 Stack
I. Push :
Adds an item in the stack. If the stack is full, then it is said to be an
Overflow condition.
II. Pop :
Removes an item from the stack. The items are popped in the
reversed order in which they are pushed. If the stack is empty, then
it is said to be an Underflow condition.
4
3.2 Queue
• Elements is inserted from one end called REAR and deleted from the other end
called as FRONT.
• Front points to the beginning of the queue and Rear points to the end of the
queue.
• Queue follows the FIFO (First - In - First Out) structure.
• According to its FIFO structure, element inserted first will also be removed first.
• In a queue, one end is always used to insert data (enqueue) and the other is used
to delete data (dequeue), because queue is open at both its ends.
• The enqueue() and dequeue() are two important functions used in a queue.
5
3.3 Doubly linked list
3.3.1 Structure in c
struct node
{
struct node *prev;
int data;
struct node *next;
}
6
3.4 Modules
Admin has the authority to search and view the record of all the users. In
record every user name and phone number with his/her status weather
allotted or not .
3.4.2 Signup
Users can signup with their details like username and phone number. So
that user can be able to login and to communicate with other users who are a
member of this application.
3.4.3 Login
Users are signed up with their credentials. Then user can login with their
credentials and can use this application easily. They can communicate with
other user’s using this application which is terminal based application.
3.4.4 Leave
Users can leave this application if they are having trouble or not interested
in this application.
3.4.5 Exit
Users or admin using this terminal based application. After the usage they
can come out terminal by choosing the Exit option in the application. So the
terminal will be closed.
7
3.5 Implementation in c language
#include<stdio.h>
#include<stdlib.h>
#include<malloc.h>
#include<string.h>
void startup();
struct no{
struct no *ne;
char name[30],mob[30];
struct nod{
char name[30],mob[30],msg[30];
struct node{
struct no *top;
int codeid;
char name[30],mob[30],status[30];
8
};//for doubly linked lists --->the main Database
void viewAllRec(){
printf("\n");
ptr=start;
if(ptr==NULL){
else{
while(ptr!=NULL){
ptr=ptr->next;
void searchRec(){
int flag=0;
9
char mob[30];
scanf("%s",mob);
ptr=start;
while(ptr!=NULL){
if(strcmp(ptr->mob,mob)==0){
ptr=ptr->next;
flag=1;
break;
ptr=ptr->next;
if(flag==0){
void leave(){
10
char mob[30];
scanf("%s",mob);
ptr=start;
while(ptr!=NULL){
if(strcmp(ptr->mob,mob)==0){
strcpy(ptr->name,"0");
strcpy(ptr->mob,"0");
strcpy(ptr->status,"unallocated");
strcpy(ptr->name,"0");
ptr->f=ptr->r=NULL;ptr->top=NULL;
ptr=ptr->next;
struct no *nn;
11
nn=(struct no*)malloc(sizeof(struct no));
strcpy(nn->name,name);
strcpy(nn->mob,mob);
nn->ne=NULL;
ptr=start;
while(ptr!=NULL){
if(strcmp(ptr->mob,recMob)==0){
if(ptr->top==NULL){
nn->ne=NULL;
ptr->top=nn;
else{
nn->ne=ptr->top;
ptr->top=nn;
ptr=ptr->next;
}//for stack
12
void pop(char mob[]){
struct no *temp;
int flag=0;
ptr=start;
while(ptr!=NULL){
if(strcmp(ptr->mob,mob)==0){
if(ptr->top==NULL){
flag=1;
else{
temp=ptr->top;
ptr->top=ptr->top->ne;
free(temp);
if(flag==0){
13
pop(mob);
else if(flag==1){
break;
ptr=ptr->next;
}//for stack
//printf("%s %s %s %s",recMob,msg,name,mob);
strcpy(nn->name,name);
strcpy(nn->mob,mob);
strcpy(nn->msg,msg);
nn->nex=NULL;
ptr=start;
while(ptr!=NULL){
14
if(strcmp(ptr->mob,recMob)==0){
if(ptr->f==NULL){
ptr->f=ptr->r=nn;
ptr->r->nex=ptr->f->nex=NULL;
else{
ptr->r->nex=nn;
ptr->r=nn;
ptr->r->nex=NULL;
ptr=ptr->next;
}//for queue
int flag=0;
ptr=start;
15
while(ptr!=NULL){
if(strcmp(ptr->mob,mob)==0){
if(ptr->f==NULL){
flag=1;
else{
temp=ptr->f;
ptr->f=ptr->f->nex;
free(temp);
if(flag==0){
dequeue(mob);
else if(flag==1){
break;
16
}
ptr=ptr->next;
}//for queue
void login(){
char name[30],mob[30],recName[30];
char recMob[30],msg[30];
scanf("%s",name);
scanf("%s",mob);
ptr=start;
while(ptr!=NULL){
if(strcmp(ptr->name,name)==0&&strcmp(ptr->mob,mob)==0){
flag=1;
while(1){
17
printf("\nEnter your choice:\n1.Send a Message\n2.View All
Recieved Msg\n3.view Recent contacts\n4.Logout\n");
scanf("%d",&opt);
switch(opt){
case 1:
scanf("%s",recMob);
printf("\nEnter Message\n");
scanf("%s",msg);
ptr1=start;
while(ptr1!=NULL){
if(strcmp(ptr1-
>mob,recMob)==0){
strcpy(recName,ptr1-
>name);
18
strcpy(recMob,ptr1-
>mob);
ptr1=ptr1->next;
//printf("%s %s %s %s %s
",recMob,msg,name,mob,recName);
push(mob,recName,recMob);//in ur
stack push recevers name , mob
push(recMob,name,mob);//in
recievers stack push ur name , mob
break;
case 2:
//printf("%s",mob);///////////////////////////////////////////////////////////////////////////
dequeue(mob);//dequeue my queue
completely
break;
case 3:
//printf("%s",mob);///////////////////////////////////////////////////////////////////////////
19
pop(mob);//pop my stack
completely
break;
case 4:
startup();
break;
default:
printf("\nWrong choice
pressed\n");
break;
ptr=ptr->next;
if(flag==0){
20
void signup(){
char name[30],mob[30];
int flag=0;
scanf("%s",name);
scanf("%s",mob);
strcpy(nn->name,name);
strcpy(nn->mob,mob);
strcpy(nn->status,"allocated");
ptr=start;
if(ptr==NULL){
start=nn;
nn->next=NULL;
nn->prev=NULL;
nn->f=NULL;nn->r=NULL;nn->top=NULL;
nn->codeid=1;
21
}
else{
while(ptr!=NULL){
if(strcmp(ptr->status,"unallocated")==0){
flag=1;
strcpy(ptr->name,name);
strcpy(ptr->mob,mob);
strcpy(ptr->status,"allocated");
ptr->f=NULL;ptr->r=NULL;ptr->top=NULL;
break;
ptr=ptr->next;
if(flag==1){
else{
ptr=start;
while(ptr->next!=NULL){
22
ptr=ptr->next;
nn->prev=ptr;
ptr->next=nn;
nn->next=NULL;
nn->codeid=nn->prev->codeid+1;
nn->f=NULL;nn->r=NULL;nn->top=NULL;
void admin(){
int opt;
while(1){
scanf("%d",&opt);
switch(opt){
case 1:
searchRec();
23
break;
case 2:
viewAllRec();
break;
case 3:
startup();
break;
default:
void startup(){
int opt;
while(1){
printf("\n1.Admin Panel\n2.signup\n3.login\n4.leave\n5.Exit\n");
scanf("%d",&opt);
switch(opt){
24
case 1:
admin();
break;
case 2:
signup();
break;
case 3:
login();
break;
case 4:
leave();
break;
case 5:
exit(0);
default:
25
}
int main(void){
startup();
return(0);
26
CHAPTER-4
4 RESULTS
27
Figure 5 User-1 Signup
28
Figure 6 User-2 Signup
29
Figure 7 User-1 Login
30
Figure 8 User-2 Login
31
Figure 9 Message sending by user-1
32
Figure 10 Message seen by user-2
33
Figure 11 Admin page
34
Figure 12 View all records by admin
35
CHAPTER-5
5 CONCLUSION
Real time chat is virtually any online communication that provides a real
time or live transmission of text messages from sender to receiver. It’s
lightweight to use the terminal for our chat, as there is no opening of the
browser, loading of JS libraries or any frontend code. Also, it allows us to
quickly test our ideas without worrying about what the user interface would
look like.
36
CHAPTER-6
6 BIBILOGRAPHY
37
[9] Badre, A. (2002): Shaping Web Usability. Boston: Pearson Education,
Inc.
[10] Banfield, E. G. (1989): International Social Science. New York:
Vander
38