Re: passing a pointer to a struct to a function that uses ncurses



mark.e.nelson@xxxxxxxxx wrote:

In addition to what A. Sinan Unur said...

<snip>

int display_form(form_data *data)
{
FIELD *field[2];

This defines an array of 210 pointers to FIELD...

FORM *my_form;
int ch;

// initialise curses
initscr();
cbreak();
noecho();
keypad(stdscr, TRUE);

// initialise the fields
field[0] = new_field(1, 40, 4, 18, 0, 0);

This writes to the first element of field...

field[1] = new_field(1, 40, 6, 18, 0, 0);

This writes to the second element of field...

field[2] = NULL;

This write to the ... oops, there is no third element to write to!

<snip>
--
Flash Gordon, living in interesting times.
Web site - http://home.flash-gordon.me.uk/
comp.lang.c posting guidelines and intro:
http://clc-wiki.net/wiki/Intro_to_clc
.



Relevant Pages

  • Re: Haldanes Dilemma - clarifications - and Felsenstein [LONG]
    ... This sounds like a consequence of the theory of 'nearly neutral' selection. ... We take two at random, and return the one with the highest fitness, ... int choose ...
    (sci.bio.evolution)
  • Re: c interview
    ... undefined behaviour because printf is a varidac function. ... stdio.h before using printf and other headers as appropriate before ... Would make it a point that the size of int is assumption to be .... ...
    (comp.lang.c)
  • Re: || putchar(ch == 177 ? ? : ch | 0100) == EOF)
    ... snip 160 lines of obsolete commentary ... void filecopy(FILE *ifp, FILE *ofp) ... int ch; ... Since you expect the file to contain control character, ...
    (comp.lang.c)
  • Re: for loop problem
    ... int flushln{ ... gcc chokes big-time on this until I add #include, ... snip about 150 lines of spouting ... ... I don't recall requesting that 150 odd lines of spouting about your ...
    (comp.lang.c)
  • Re: stream io in c
    ... If you are using tabs to indent your code, consider switching to spaces, ... And note that 'c' is declared as an int, ... unsigned char. ...
    (comp.lang.c)