Friday, December 11, 2009

Sample program 3

import "test5.o";

%constraint listSize != 0 %exec %print "The size of the list is zero";
%constraint listSize >= 0 %exec %print "IMPOSSIBLE VALUE:The size of the list is negative!";
%constraint listSize != LIST_MAX %exec %print "List max reached.";

listAdd("Tom");
listAdd("Dick");
listAdd("Harry");

listRemove("Peter");
listRemove("Harry");
listRemove("Tom");
listRemove("Harry");

No comments:

Post a Comment