prog.c: In function ‘init’:
prog.c:20:2: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
}printf("\n\t\t\t %d\t no link \t no hop",router[r].a[i][1]);
^~~~~~
prog.c:20:2: warning: incompatible implicit declaration of built-in function ‘printf’
prog.c:20:2: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
prog.c:21:1: error: ‘else’ without a previous ‘if’
else
^~~~
prog.c:22:8: warning: too many arguments for format [-Wformat-extra-args]
printf("\n\t\t%d\t%d\t\t d",router[r].a[i][1],router[r].a[i][2],router[r].a[i][3]);
^~~~~~~~~~~~~~~~~~~~
prog.c: At top level:
prog.c:24:1: error: expected identifier or ‘(’ before ‘}’ token
}
^
prog.c: In function ‘dv_algo’:
prog.c:26:2: error: ‘include’ undeclared (first use in this function)
{include<stdlib.h>
^~~~~~~
prog.c:26:2: note: each undeclared identifier is reported only once for each function it appears in
prog.c:26:10: error: ‘stdlib’ undeclared (first use in this function)
{include<stdlib.h>
^~~~~~
prog.c:28:2: error: invalid preprocessing directive #defi
#defi
^~~~
prog.c:29:1: error: expected expression before ‘{’ token
{
^
prog.c:37:2: error: invalid preprocessing directive #defi
#defi
^~~~
prog.c:49:2: error: invalid preprocessing directive #defi
#defi
^~~~
prog.c: In function ‘main’:
prog.c:55:8: error: ‘r’ undeclared (first use in this function)
router[r].a[r][2]=0;
^
prog.c: In function ‘inp’:
prog.c:62:1: warning: incompatible implicit declaration of built-in function ‘printf’
printf("\n Enter dist from the node %d to other nodes",r);
^~~~~~
prog.c:62:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
prog.c:63:8: warning: too many arguments for format [-Wformat-extra-args]
printf("\n pls enter 999 if there is no direct routr \n",r);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.c:69:1: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
scanf("%d",&router[r].a[i][2]);
^~~~~
prog.c:69:1: warning: incompatible implicit declaration of built-in function ‘scanf’
prog.c:69:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
prog.c: In function ‘display’:
prog.c:77:1: warning: incompatible implicit declaration of built-in function ‘printf’
printf("\n\n The routing table for nodes %d is as follows:",r);
^~~~~~
prog.c:77:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
prog.c:79:1: error: ‘else’ without a previous ‘if’
else
^~~~
prog.c:80:8: warning: too many arguments for format [-Wformat-extra-args]
printf("\n\t\t%d\t%d\t\t d",router[r].a[i][1],router[r].a[i][2],router[r].a[i][3]);
^~~~~~~~~~~~~~~~~~~~
prog.c:76:7: warning: unused variable ‘j’ [-Wunused-variable]
int i,j;
^
prog.c: At top level:
prog.c:82:1: error: expected identifier or ‘(’ before ‘}’ token
}
^
prog.c:83:6: error: redefinition of ‘dv_algo’
void dv_algo(int r)
^~~~~~~
prog.c:25:6: note: previous definition of ‘dv_algo’ was here
void dv_algo(int r)
^~~~~~~
prog.c: In function ‘dv_algo’:
prog.c:84:2: error: ‘include’ undeclared (first use in this function)
{include<stdlib.h>
^~~~~~~
prog.c:84:10: error: ‘stdlib’ undeclared (first use in this function)
{include<stdlib.h>
^~~~~~
prog.c:86:2: error: invalid preprocessing directive #defi
#defi
^~~~
prog.c:87:1: error: expected expression before ‘{’ token
{
^
prog.c:95:2: error: invalid preprocessing directive #defi
#defi
^~~~
prog.c:107:2: error: invalid preprocessing directive #defi
#defi
^~~~
prog.c: At top level:
prog.c:110:5: error: redefinition of ‘main’
int main()
^~~~
prog.c:52:5: note: previous definition of ‘main’ was here
int main()
^~~~
prog.c: In function ‘main’:
prog.c:114:1: warning: incompatible implicit declaration of built-in function ‘printf’
printf("\nEnter the no of nodes required (less than 10 pls):");
^~~~~~
prog.c:114:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
prog.c:115:1: warning: incompatible implicit declaration of built-in function ‘scanf’
scanf("%d",&no);
^~~~~
prog.c:115:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
prog.c:137:9: warning: format ‘%d’ expects a matching ‘int *’ argument [-Wformat=]
scanf("%d%d,&x,&y");
^
prog.c:137:11: warning: format ‘%d’ expects a matching ‘int *’ argument [-Wformat=]
scanf("%d%d,&x,&y");
^
prog.c:138:8: warning: missing terminating " character
printf("\nThe length of the shortest path is %include<stdlib.h>
^
prog.c:138:8: error: missing terminating " character
printf("\nThe length of the shortest path is %include<stdlib.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.c:140:2: error: invalid preprocessing directive #defid
#defid",router[x].a[y][2]);
^~~~~
prog.c:140:7: warning: missing terminating " character
#defid",router[x].a[y][2]);
^
prog.c:141:1: error: expected expression before ‘}’ token
}
^
prog.c:141:1: error: expected ‘;’ before ‘}’ token
prog.c:112:11: warning: unused variable ‘y’ [-Wunused-variable]
int i,j,x,y;
^
prog.c:112:9: warning: unused variable ‘x’ [-Wunused-variable]
int i,j,x,y;
^
prog.c:112:7: warning: unused variable ‘j’ [-Wunused-variable]
int i,j,x,y;
^
prog.c: At top level:
prog.c:143:2: error: expected identifier or ‘(’ before ‘for’
}for(i=1;i<=no;i++)
^~~
prog.c:143:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<=’ token
}for(i=1;i<=no;i++)
^~
prog.c:143:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘++’ token
}for(i=1;i<=no;i++)
^~
prog.c:150:1: error: expected identifier or ‘(’ before ‘}’ token
}
^
prog.c:151:6: error: redefinition of ‘dv_algo’
void dv_algo(int r)
^~~~~~~
prog.c:25:6: note: previous definition of ‘dv_algo’ was here
void dv_algo(int r)
^~~~~~~
prog.c: In function ‘dv_algo’:
prog.c:152:2: error: ‘include’ undeclared (first use in this function)
{include<stdlib.h>
^~~~~~~
prog.c:152:10: error: ‘stdlib’ undeclared (first use in this function)
{include<stdlib.h>
^~~~~~
prog.c:154:2: error: invalid preprocessing directive #defi
#defi
^~~~
prog.c:155:1: error: expected expression before ‘{’ token
{
^
prog.c:163:2: error: invalid preprocessing directive #defi
#defi
^~~~
prog.c:175:2: error: invalid preprocessing directive #defi
#defi
^~~~
prog.c: At top level:
prog.c:178:5: error: redefinition of ‘main’
int main()
^~~~
prog.c:52:5: note: previous definition of ‘main’ was here
int main()
^~~~
prog.c: In function ‘main’:
prog.c:182:1: warning: incompatible implicit declaration of built-in function ‘printf’
printf("\nEnter the no of nodes required (less than 10 pls):");
^~~~~~
prog.c:182:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
prog.c:183:1: warning: incompatible implicit declaration of built-in function ‘scanf’
scanf("%d",&no);
^~~~~
prog.c:183:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
prog.c:205:9: warning: format ‘%d’ expects a matching ‘int *’ argument [-Wformat=]
scanf("%d%d,&x,&y");
^
prog.c:205:11: warning: format ‘%d’ expects a matching ‘int *’ argument [-Wformat=]
scanf("%d%d,&x,&y");
^
prog.c:206:8: warning: missing terminating " character
printf("\nThe length of the shortest path is %include<stdlib.h>
^
prog.c:206:8: error: missing terminating " character
printf("\nThe length of the shortest path is %include<stdlib.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.c:208:2: error: invalid preprocessing directive #defid
#defid",router[x].a[y][2]);
^~~~~
prog.c:208:7: warning: missing terminating " character
#defid",router[x].a[y][2]);
^
prog.c:209:1: error: expected expression before ‘}’ token
}
^
prog.c:209:1: error: expected ‘;’ before ‘}’ token
prog.c:180:11: warning: unused variable ‘y’ [-Wunused-variable]
int i,j,x,y;
^
prog.c:180:9: warning: unused variable ‘x’ [-Wunused-variable]
int i,j,x,y;
^
prog.c:180:7: warning: unused variable ‘j’ [-Wunused-variable]
int i,j,x,y;
^