#define ENDFILE "CTRL-Z"

this end the file whenever the user enter CTRL-Z
what i need, i want the user 2 enter CTRL-X to end the program

#define ........ "CTRL-X" ( what could i write here)
so the program end whenever the user press CTRL-X

Recommended Answers

All 3 Replies

Are you using the

#ifndef CTRL-X_H
#define CTRL-X_H

#endif

#define ENDFILE "CTRL-Z"

You have them enter this text? Or are you meaning a single keystroke? (If you mean a keystroke, I'd guess you're not doing this right.)

what i need, i want the user 2 enter CTRL-X to end the program

#define ........ "CTRL-X" ( what could i write here)
so the program end whenever the user press CTRL-X

If you are trying to intercept keystrokes, you may be interested in signals.

hey tnx guys
i fixed the problem :D
tnx 4 yr effort

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.