RE: size_t ?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks David !

--
Best regards
Robert


"Robby" wrote:

> Hi,
>
> As you may know from other numerous questions that I have recently posted, I
> am trying to begin Windows programming, and I felt the need to go back a few
> chapters and once and for all understand character types in Windows.
>
> I have been reading up on UNICODE, hence normal characters and wide characters
> and personally, I think Windows got complicated, but probably had no choice
> given that computers started of with an 8 bit ascii bytes.... But one thing
> is for sure, is that I find myself reading complex documentation that refers
> to excuse the expression, "under the window's hood information", causing me
> to read it several times to try and make sence of it.
>
> Sure I can just skip it and just take it for granted that a char type is
> just a char type and the hell with where TCHAR comes from. But I just can't
> do that.
>
> I have appreciated all your help guys....
>
> OKAY, My question....
>
> I have read that:
>
> wchar * pc = "Hello";
> iLenght = strlen(pc);
>
> is a pointer to a chartacter string, where iLenght will get the lenght of
> the string stored at the location of pc. And that if I do this:
>
> wchar * pw = L"Hello";
> iLenght = strlen(pw);
>
> we will get a warning stating that the strlen function accepts a pointer to
> a character but is getting a pointer to an unsigned short. So we must use:
>
> iLenght = wcslen (pw)
>
> instead.
>
> It has been written that wcslen is the wide character version of the strlen
> and declared in STRING.H and WCHAR.H.
>
> Here is the start of my gray zone:
>
> -Why declared in 2 locations?
> -Can I view this, to satisfy my curiosity (I typed out both files in a
> search and I did not find the following declarations)?:
>
> size_t __cdecl strlen (const char *)
> size_t __cdecl wcslen (const wchar_t *)
>
> -Is size_t an integer type, and where is it declared in the windows header
> files
> and how is it declared?
> -And what does the __cdecl mean?
>
> To experienced programmers, these are surely no brainers, to myself its what
> I would fully love to explore!
>
> All information appreciated!
>
> --
> Best regards
> Robert
.



Relevant Pages

  • size_t ?
    ... chapters and once and for all understand character types in Windows. ... iLenght = strlen; ... search and I did not find the following declarations)?: ...
    (microsoft.public.vc.language)
  • Re: newbie question for reading input file
    ... Declarations are *VERY* important. ... feature is using a real variable to store character values. ... You have to use an explicit format with an appropriate "A" edit ... unused data edit descriptors at the end of the format are ignored, ...
    (comp.lang.fortran)
  • Re: TRIM
    ... Dick Hendrickson wrote: ... > CHARACTER ... ANY OTHER NEEDED DECLARATIONS ... no deficiencies and the other way is to make it so complicated ...
    (comp.lang.fortran)
  • Re: TRIM
    ... Dick Hendrickson wrote: ... > CHARACTER ... ANY OTHER NEEDED DECLARATIONS ... no deficiencies and the other way is to make it so complicated ...
    (comp.lang.fortran)
  • Re: f77 - conversion of hollerith integers to character
    ... track of which variables are used in each subroutine for character ... Then more passes through for any assignment statements using ... Then a pass to generate CHARACTER declarations and remove those ...
    (comp.lang.fortran)