int, float , double ? what are they used for?
I wish I could help you, but I donāt particularly like programming, I prefer chess,
in any case I canāt help you with that.
I hope somebody else can.
I send you my love,
Erez.
@anon48059102 I do have advice.
Get a book and try to learn from it.
There are websites from which you can download books for free.
If you Google āfree c++ courseā thereās a lot of options to investigate.
Like this
Are you new to programming? I would suggest python. Python is being used for introductory courses to learn computer programming and CS. There are tons of resources for python and other languages online. To learn C++, I would get a good book or take a class at your local college. I never studied C++. Itās supposed to be hard. Just my 2 cents. Iām in no way a programmer but I can program basic stuff. For instance, I can write a 100-200 line program in python. Javascript is pretty popular now a days.
Anyways, in python, an int is an integer, a float is a decimal number. I donāt know what a double is. Sometimes you want more precision in your calculation so you use a float instead of an integer. Sometimes you want a char instead of a number which is just a string.
Moved to School and Work.
lol lol just kidding.
pm me. I know some C and C++
Those are the data types. Int is integer and float and double are numbers that have decimals. You have to initialize your variables before you can use them.
I know C++ and Java. So ask away. YouTube is also a great resource.
Iām about to learn the basics of java. coded with C++ for 6 months.
C++? really? itās basically deprecated by now. learn a newer language like Python.
learning any language can be a (cough) fun (cough) challenge for Spooky.
but I did learn Python firstā¦
Bloodshed c++ development
No habla CS. Canāt help. Sorry. But I do know that if you have a valid library card, you can often access very good courses at Lynda.com for free. Itās an awesome website where you can learn lotās of things computer related. Even if you pay for a membership, itās worth it if you actually put in the time to learn.
https://www.lynda.com/
āintā is an integer, a whole number, positive or negative. floats are rarely used. theyāre low-precision numbers like you used to see on calculators 3.649383428E+28. That sort of thing. doubles donāt take up much more memory and offer significantly more precision.
can someone explain me what is basic syntax , and how can i use it
it describes as this
When we consider a C++ program, it can be defined as a collection of objects that communicate via invoking each otherās methods. Let us now briefly look into what do class, object, methods and Instance variables mean.
Object ā Objects have Properties and Behaviors. Example: A dog has Properties - color, name, breed as well as Behaviors - wagging, barking, eating. An object is an instance of a class.
Class ā A class can be defined as a template/blueprint that describes the behaviors/states that object of its type support.
Methods ā A method is basically a behavior. A class can contain many methods. It is in methods where the logics are written, data is manipulated and all the actions are executed.
Instance Variables ā Each object has its unique set of instance variables. An object's state is created by the values assigned to these instance variables.
can you comment it to me , cuz it would i understand it more, and be more interesting to learn,
THANX
yhese toutorials is so confusing to me :DDD
I would try getting āProgramming and Principlesā book authored by Bjarne Stroustrup, a guy who helped develop C++.
online tutorials are usually poorly brief and require both internet and a computer. a book rarely needs internet. and book readings donāt require a computer, though exercises do.
āProgramming and Principlesā is the book that my college used to teach beginning C++ programming to freshmen.
learning the basics, of a programming language, takes time. and thereās always more to learn about a program. so a tutor or teacher would be very helpful.
int are for quantities they hold numbers without any decimals
floats store decimals and so can doubles
doubles are more precise than floats but they are a little slower
double hold twice as many digits as floats
i use floats all the time in my videogame because I donāt need the precision
you use classes to make objects
objects have instance variables that are separate for each object you create
methods are functions or subroutines they are code that you can run and they can return values
Dog dog = new Dog(); //Dog is a class, dog is an object
dog.bark(); //bark is a method
dog.foodbowl = 1f; //refill foodbowl to 100%, foodbowl is an instance variable
It just doesnāt make sense to use floats, especially nowadays with 64-bit processors (a double is 8 bytes). Floats are only accurate to six significant digits, which makes them good for things like font sizes, but . . . hell, do what you want. Just donāt compare them for equality. I learned that lesson the hard way.
oh snap. nerd fight! :OĀ
just kiddingā¦ lol lol lolā¦
I donāt need to compare them for equality. I use them for stuff like 3d models, color values, physics calculations that need to be calculated as fast as possible, screen coordinates, rotations. Iām not using floats to keep track of money. Being .00000001 off here and there is no big deal. As you get more experience with programming you learn to never say never. And all those micromanaging code tips are a load of crap because everybody figures out their own style.
Iāve read people saying never use āiā as a variable. Well I use āiā as a variable all the time and it works great for me. It always means iteration in my code and I know that. I have my own indentation I use too that keeps my code more compact and on the screen. Iām not scared to use a label when I need one. Another is to make instance variables always private access. Sometimes there is no point in doing that!