Auto has been used here as the data type, why?

what is the data type find() return, and what is the code to find the data type of a variable in c++.

@namanmittal0007 find returns the location of the element found and auto is a datatype that automatically takes the type of the value assigned to it.
i hope its clear if yes dont forget to hit like and mark resolved :smiley:

what is the code to find the data type of a variable in c++?

here ita given at this link

already tried this but this doesn’t gives a correct ans.

@namanmittal0007 what do you want to do like give some example

okay,
int main(){
int x=5;
}
here its clear that x is of type int but still if i want to print it’s datatype how can i do so?
the already tried the stackoverflow ans before asking the question to you for int it just print i which isn’t specified, like in the code for what i started the doubt auto is used and i want to know what datatype it is using, for that i want to know if some function exists or not?
you getting me?

@namanmittal0007 yeah got you the stackoverflow one is giving correct i tried int n=5 it gives i which represents integer , d for double, map for map and vector for vector whats the problem?

St6vectorIiSaIiEE this is what if output when i try it for a vector p;, if you could help me understand what it means.

@namanmittal0007 in between it displays vector (all other things i think is somewhat related to it documentation just read the documentation for typeid if interested)

ohh, okay. Thanks :slight_smile:

@namanmittal0007 np just mark it resolved :smiley:

how can i mark it resolved? Here’s just 4 options available bookmark,share,flag and reply.

@namanmittal0007 in your portal where there is also doubt option you can also see your doubts (in there somewhere)

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.