Files
2022-12-13 12:44:04 +01:00

24 lines
856 B
C++
Executable File

#include <cdevCollection.h>
char * devices[] = {"device0", "device1", "device2", "device3"};
void main ( void )
{
/**************************************************************
* Attach to the cdevCollection "brandNew" and add four device
* names to it.
**************************************************************/
cdevCollection & brandNew = cdevCollection::attachRef("brandNew");
brandNew.add(4, devices);
/**************************************************************
* Use the getList method to obtain the array of names that are
* currently stored in the cdevCollection and display them.
* Note that the list (not the list items) msut be deleted by
* the caller.
**************************************************************/
char ** list = brandNew.getList();
for(char **s = list; *s!=NULL; s++) printf("%s\n", *s);
delete list;
}