سؤال

I use codeblocks IDE and gcc compiler. I tried to write the simple program billing system.We I use the getch(); for character input there will be no error during building the project but at run time there will be error and shows the error message like this "Drawing operation was attempted when there was no current window." What was the actual problem.

هل كانت مفيدة؟

المحلول

since you are using in windows with Code::Blocks with gcc I'm safely assumeing you are using cygwin toolchain, which is a linux like environment. So I recomend you to use system("pause") including the header stdlib.h

نصائح أخرى

You have not mentioned in what platform you are compiling. If it's Linux you can not use getch() since conio.h is only for dos. But with this error message is most probably caused by incorrect integration of gcc with Code::Blocks. Try compling with gcc directly.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top