NO

Author Topic: missing _cputs in conio.h  (Read 3821 times)

Rainer

  • Guest
missing _cputs in conio.h
« on: November 04, 2005, 10:25:04 PM »
Hello Pelle,

I am missing the function _cputs() [ cputs ] in conio.h. Perhaps you can add the function.
Same for the function _cgets(), but I think it´s a lot of work to implement this (Editingfunction).

---
Description from an old MS-Helpsystem
 The cputs function writes the null-terminated string pointed to by
 <string> directly to the console. Note that a carriage-return/
 line-feed (CR-LF) combination is not automatically appended to the
 string.

 Return Value

 If successful, cputs returns a 0. If the function fails, it
 returns a nonzero value.
---

Below my workaround in conio.h
Code: [Select]

// int __cdecl _cputs(const char * restrict);       // missing
#define _cputs(s) ( _cprint("%s",s) >= 0 ? 0 : -1 ) // Workaround

Oldnames
// int __cdecl cputs(const char * restrict);       // missing
#define cputs(s) ( cprint("%s",s) >= 0 ? 0 : -1 )  // Workaround

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
missing _cputs in conio.h
« Reply #1 on: November 05, 2005, 03:56:39 PM »
Hello,

I was hoping I could avoid adding _cputs, since _cprintf can do the same thing (and more), but maybe it should be added - at least as a macro (but a real function is probably better). Maybe possible to implement _cgets too - I will look at it...

Pelle
/Pelle

Hudkap

  • Guest
missing _cputs in conio.h
« Reply #2 on: August 03, 2006, 09:12:19 AM »
It is really??