ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
not really important, just some additional info: https://en.wikipedia.org/wiki/Template_(C%2B%2B)
c++98 is indeed a good start, although I think most of the modern libraries cannot be built with it.
I learned C++ by writing C++ code. My first steps were eMule mods - I modified them, then started my own ones by copying other people's code, then learned C++ by fixing compilation errors after having done so ...
you need to show the code you tried, showing just the name of the variable (and also showing a single dot) is just meaningless for us.
But anyway, . means membership (or ownership?), this time field is member of the status_data class or struct, and therefore you can specify the type of the members where you declare the whole class.
If you don't show the relevant excerpt of your actual code and maybe a little bit of your data, then it is unrealistic to expect anyone to be able to help you in any meaningful way. (See the various "stickies" about how to ask an answerable question.)
i'm reading data in from a file and trying to declare one of the variables as a double. trouble is the variable has a
Code:
.
in it's name.
Code:
status_data.time
is the name of the variable. the compiler doesn't like that. what can i do?
The "dot" has special meaning in variable names in C/C++ and most other programming languages. It is not treated as a character but is instead an operator, the dot operator. If you try to treat it as a single character in variable names the compiler will rightfully complain.
As others have suggested, it would be helpful if you included a little more information in your questions. Please review the Site FAQ for guidance in asking well formed questions. Especially visit the link from that page, How to Ask Questions the Smart Way for discussion of things to consider when asking others for help.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.