program display nodes

Hello,i has create the program which display nodes with links,how to fix it,so i can display in with multiple nodes such as 12 13 14 15 16 27

12 mean 1 connect to 2 and 13 mean one connect to 3 and so forth
my program is accept file as input .
while(!infile.eof())
{
int* Nodearray = new int[MaxNoOfNodes];
int* Array = new int[Links];
bool select = true;
for(int i = 0; i < Links; i++)
{
Array[i] = 0;
}
for(int i = 0; i < Links; i++)
{
infile >> Array[i];
}
for(int i=0;i<MaxNoOfNodes;i++)
{
Nodearray[i] = 0;
}
for(int i=0;i<Links;i++)
{
node = Array[i]/10; Nodearray[node-1] = 1;
}
for(int i=0;i<Links;i++)
{
node = Array[i]%10; Nodearray[node-1] = 1;
}
for(int i=0;i<MaxNoOfNodes;i++)
{
if(Nodearray[i] == 0)
{
select = false;
break;
}
}
if(select)
{
for(int i=0;i < Links ; i++)
{
myfile << Array[i] << " ";
}
myfile << endl;
}
delete[] Nodearray;
delete[] Array;
}
this is my code,hope u all can help me
Topic archived. No new replies allowed.