flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
vid
wtf?
first you ask something, and then you say not to tell you the answer? |
|||
![]() |
|
0.1
simply because those function are defined by C standard!
i wanted to know if there are windows api specifics? |
|||
![]() |
|
vid
yes, microsoft did lot of custom libc-like functions
|
|||
![]() |
|
bitRAKE
What is it you are trying to avoid? Including runtime DLL, or the C-like interface? The API has functions like wsprintf which will do the conversion and user32 is very likely to be mapped into address space. kernel32 has string functions as well.
|
|||
![]() |
|
0.1
well ... for example the scanf is defined by C standard so it should be there but can not use full platform support!
what I was looking (at least hoping) for was any particular conversion function in the API itself (different from C functions). I was wondering if I could find more powerful (having more control maybe) functions in the API. Take a simple example: I use: scanf("%d", &num); but user enters: abcd now scanf() can't manage that very well! so may be an API function is there which would plain reject (and may be beep as well) all the other data except one which it was supposed to read! I made and earlier post seeking for an API specific function to read from kbd. I was hoping to find a function that would allow some more editing features besides just the back space! |
|||
![]() |
|
vid
Quote: now scanf() can't manage that very well! What it can't manage so well about it? You just have to learn how to use it. There is one thing that scanf doesn't manage well for some reason though - overflows. |
|||
![]() |
|
0.1
i expected an integer!
user enters a string! go figure! what scanf can't handle! |
|||
![]() |
|
vid
again.. what doesn't scanf() handle about it? what should it do differently?
|
|||
![]() |
|
0.1
OMG!
why don't you understand? scanf will return me wrong data! but if some function existed that would not allow me type anything besides digits ... and it's possible if i use API features I guess! may god help me! |
|||
![]() |
|
bitRAKE
0.1, yeah - that is a problem. Best use an edit control that is limited to numbers, or you'll have to loop for user to re-enter or cancel.
|
|||
![]() |
|
vid
Quote: scanf will return me wrong data! scanf returns perfectly valid result, it's just that you can't use it properly. Before trying to use some function, study how to use it: http://msdn2.microsoft.com/en-us/library/9y6s16x1(VS.71).aspx Quote: but if some function existed that would not allow me type anything besides digits ... You don't understand how streams work. "scanf" doesn't have any control over the code which handles console input. There may be no console at all, and STDIN can be redirected from file. |
|||
![]() |
|
0.1
whatever the doo-hee-kee you said vid!
i know scanf has no control coz stdin can be blah blah blah that's exactly why i am looking for a replacement from api! i would post my code (that would not allow invalid data (on console!)) in an hour or so ... but i don't have pc at home and i can't do this at work! |
|||
![]() |
|
vid
Quote: that's exactly why i am looking for a replacement from api! There is no such function... it would be pretty stupid idea, and it will fail in case there is no console. You can write such function yourself, but it won't be so trivial, and there is no point in doing it. Instead, check if user entered valid number, and if not, display error |
|||
![]() |
|
Madis731
Maybe he wanted atoi() itoa() ^o) Aren't they Uindooze
![]() |
|||
![]() |
|
AlexP
Okay, I've seen a getch() good-looking loop that would, upon entering a number/character, immediately print a * in the position. It works so fast under C that you couldn't tell, so that would work for you?? Just use getch() in a pretty loop?? I use it all the time for pauses in my prgms, either that or submit to using the vas array of C RUNTIME LIBRARIES THAT COME WITH WINDOWS IN THE FIRST PLACE!!! Don't be die hard because those functions in the C library are part of Windows API, u are the one not getting it.
|
|||
![]() |
|
0.1
_________________ Code: o__=- ) (\ /\ |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.