What is the exact meaning of int here ?
Initialize array ? name ?
What is the exact meaning of int here ?
Initialize array ? name ?
Introduction to C - Cprogramming.com
int is short for integer
Tim S.
"...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson
Is it ok to say it like this for the sake of understanding ,
Int line called firstnumber , secondnumber, sumoftwonumbers ?
No, to put that line in words:
"Declare three variables of type int, with names firstNumber, secondNumber and sumOfTwoNumbers"
Devoted my life to programming...
OK , i think its easier for me to see it like this .
Initialize Integer line called firstnumber , secondnumber, sumoftwonumbers
Thanks
This is a declaration.
int a;
This is an initialization.
int a = 0;
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Totally out of topic but this brings out a question I have about a silly, in my eyes, rule they have at my school: not to initialize a variable during declaration, e.g int i = 0.
Is there any particular reason why this could be considered a wise practice or is it just trolling on their part to make us waste lines -there's a 25 line limit per function...
> not to initialize a variable during declaration, e.g int i = 0.
You're right, your school is bone-head stupid not to allow initialisation of variables.
The world is knee deep in problems caused by uninitialised variables.
CVE -Search uninitialized
Back in the mists of time, when compilers were dumb and computers were slow, initialisation cost something.
But modern compilers will optimise out initialisations if you subsequently assign another value without using the first value.
Plus the compilers (and tools like Coverity and Klocwork) are very good at finding 'use before initialisation' issues.
> there's a 25 line limit per function...
At least they're getting something right.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.