#include<fstream.h>
#include<LINK/graph/UBinGraph.h>
#include<LINK/graph/Attribute.h>

void main()
{
	UBinGraph g1;
	if (newAttribute((Graph*)&g1, "test_attr", 1.0) != LINK_OK)
		error("Attr.cc: error creating test_attr");
	g1.addVertices(2);
    	Vertex** vertices = g1.vertexStart();
	setAttribute((GraphObject*)vertices[1], "test_attr", 8.0);
	ofstream fout;
	fout.open("g1.g", ios::out);
	g1.saveToFile(&fout);
	ifstream fin;
	fin.open("g1.g", ios::in);
	char ch;
	while (fin.get(ch))   cout.put(ch);
}
