1
Hi. I started the computer science course this year and had never been able to study any programming until then, so maybe that’s why I’m having such basic mistakes.
My problem right now is with the C library, which I have to use to do the final work of my subject, which is a game.
The teacher spent some activities for us to learn to use conium, but for now the only thing I could do was to install it hahaha The first activity outside this was "2) Implement a void function that prints a letter read from the keyboard in position (x, y) using the functions of Conio.". Looking at the functions of , I thought the function "putchxy" does just that, but when putting it in my program and compiling, I think it is doing absolutely nothing, because it should print the character read and does not do that. I used arbitrary values defined within the program for x and y.
#include <stdio.h>
#include <conio2.h>
#include <conio.h>
int main ()
{
char ch;
int x = 5, y = 5;
printf("Digite uma letra no teclado:\n");
scanf(" %c", &ch);
void putchxy (int x, int y, char ch);
return (0);
}
Since this was my last class, I’m pretty sure I’m still doing it right. But looking at the slides passed in class, reading about the function inside the library itself, looking for similar cases here in the stack overflow, I could not find anything that indicated me any error in my code.
I tried to write in other ways, I tried to create myself another function, I tried to invert, put the numbers themselves, but beyond that no other compilation properly.
Where did I go wrong?
The error is in using the
conio
, it is considered obsolete and non-standard.– Maniero
It is a work for a course of the first semester of the course, I think you can forgive right
– LucasCardoso910
And besides not being standard or usable on other operating systems like Mac or Linux, this makes your code not portable. Put this aside, you just set the function
putchxy
instead of calling her– Isac
But how would I do that? I tried it in some ways, but none of it worked, so I thought that might have been my mistake, but looking at the ways I found to do it, it didn’t work.
– LucasCardoso910