please help me to create a student information portal using stucture and union program in c.it should contain five sudents.
*for inputs we should use struct and for output we should use union and it also should have a controls...previous page, next page and escape for exit. i don't know the ascii codes for the three controls..

5 Years
Discussion Span
Last Post by Ancient Dragon

I have no idea what a "student information portal" is, but from your description I would start out by coding the structure and unions. The instructions you were given most likely tell you what they should contain.

As for next and previous page, write yourself a little console program that displays the decimal values for those keys. Your program will have to use non-standard C functions and call getch() from conio.h twice because it returns 0 or 224 the first time for special keys and the second call will give you the actual code. These codes are the same as normal keys, so you will have to device some way to tell the difference between normal keys and special keys. One way I've seen that is to add 126 to the special key value, and another way is to make the special key value a negative value.

If you don't want to use non-standard C functions in conio.h then another alternative is to use ncurses library.

#include <stdio.h>
#include <conio.h>
// Main Program 
int main()
        int c = _getch();
        if( c == 0 || c == 224)
            c = _getch();
        printf("%d\n", c);

Edited by Ancient Dragon: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.