Re: how to get the data type of a veriable
- From: "Krzysztof Olczyk" <olczyk(dot)krzysztof(at)neostrada(dot)pl>
- Date: Mon, 18 Jul 2005 15:48:18 +0200
Uzytkownik <sunil.reloaded@xxxxxxxxx> napisal w wiadomosci
news:1121602609.264199.92540@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Consider that a variable is defined as int in the beginning of the
> program.
>
> Say, int ver1;
>
> It is a very lengthy program hence i want to know the type of the
> varable ver1 in the middle of the program(Assume in some function).
>
> Can you tell me how do i get the type of the variable that was defined
> previously???
>
>
Why do you bother to do so?
Is it too hard to scroll up in whatever your editor is?
Or to use "search" function?
And that condition for checking if simple variable
is of certain type and forking flow of the program
depending on the type of variable that is well-known
to be of certain type looks very strange
Certain languages like object pascal (and c++ to some degree)
have RTTI (run-time type info) but it has applications in oop
and when you deal with polymorphism.
But not in C.
I think in your problem just scrolling up or defining the variable
more locally would do.
--
Regards,
Krzysiek
.
- References:
- how to get the data type of a veriable
- From: sunil.reloaded@xxxxxxxxx
- how to get the data type of a veriable
- Prev by Date: Re: C + download
- Next by Date: Re: manipulating void* in array
- Previous by thread: Re: how to get the data type of a veriable
- Next by thread: database of C standard library functions?
- Index(es):