Skip to content

Updated Tree/AVLTREE.c with cross-platform compatibility #754

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Haricodezz
Copy link

fix: replace non-standard clrscr() with portable console clear alternative

  • Removed use of clrscr(), which is not part of the standard C library and causes compatibility issues across compilers and OS.
  • Added comments suggesting portable alternatives: system("cls") for Windows and system("clear") for Unix-like systems.
  • Updated code to use system-specific command with optional preprocessor condition for cross-platform support.

This ensures the AVL Tree program compiles and runs correctly in standard C environments.

// clrscr();
// Replaced clrscr() with system-specific clear command for portability.
#ifdef _WIN32
system("cls"); // Clear screen on Windows
#else
system("clear"); // Clear screen on Unix-like systems
#endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant