Power set: Difference between revisions

Content added Content deleted
(Add C)
Line 156: Line 156:
#include <stdlib.h>
#include <stdlib.h>


typedef char *SetType;
typedef const char *SetType;
typedef int bool;
typedef int bool;


Line 231: Line 231:
}
}


void PrintString( char *str)
void PrintString( const char *str)
{
{
printf("%s", str);
printf("%s", str);
}
}


int main(int argc, char *argv[])
int main()
{
{
char *eles[] = {"Red","Grn","Blu","Ylo"};
const char *eles[] = {"Red","Grn","Blu","Ylo"};
struct setStruct aSet = { 4, eles, PrintString, 0 };
struct setStruct aSet = { 4, eles, PrintString, 0 };
PowerSet p = GetPowerSet( &aSet);
PowerSet p = GetPowerSet( &aSet);