Ok peeps,
C++ makes it a lot easier to create forms/fields than C does so here is some code that may help C programmers:
//define field structure
struct field
{
int h_pos, v_pos, width;
char caption[35];
char *value;
} form1[10];
//display form
void disp_form( struct field form[], int...
I am lazy!! I don't want to have to write out a struct's full name any time I want to reference one of it's members.
Is there a with statement (or equivalent) in C e.g.
struct mystruct
{
int item1;
char item2;
float item3;
} struct1[20];
for(index = 0;index <20; index++)
{
with...
I am attempting to create a form in C using the following concept.
I create a field struct:
struct field
{
int index;
void *point_to_data;
char *caption;
int hor_pos, ver_pos;
} myform[15];
I also create a record struct to store data;
struct myrec
{
char *item1;
char *item2...
Folks,
There are probably better ways than this but I hope this will spark some ideas.
If you want to test a users date input for validity, try using this to define your years!!
Struct Year
{
struct month
{
int no_of_days;
char *name; //optional field if you want month names
}...
Can anyone tell me how to test input for a datatype?
I want to be able to read input into a float variable but also to identify if the user input is not compatible with a float before the program throws out an error and dies.
If I read into a char * then I can't convert the input to a float...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.