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,
@crazy_dancer_arcade_pro 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.
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.
“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,
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!