This question already has answers here:
What is the meaning of a dot (.) after an integer in c?
(2 answers)
Closed 2 years ago.
I read a code online and the next line caught my attention since I don't know why does it have a "." after the 0:
variable=0.;
I couldn't find the answer after looking for it. Could you please tell me what is the dot for?
Thanks!!
The dot makes it a double. A clearer way to write it is 0.0.
Related
This question already has answers here:
What are the rules for JavaScript's automatic semicolon insertion (ASI)?
(7 answers)
Closed 7 months ago.
If I have the following:
...
let p1 = <p>qwer</p>
let p2 = <p>asdf</p>
...
Should I put semicolons at the end of each of these?
It is not wrong to leave it like that, you can put semicolons if you want, but it is better you be consistent and follow one code style check https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
it will make your life easier
This question already has answers here:
scanf() leaves the newline character in the buffer
(7 answers)
Closed 1 year ago.
I'm new to programming, trying to learn C.
The program below is showing no signs of error still the output is not correct. I tried it without using '&' sign as "ms" and "sc" are characters but still that doesn't work. What am I doing wrong?
the problem is that you missed enclosing quotation marks in the scanf call
replace the following
line 5: scanf("%c",&ms)
line 7: scanf("%c",&sc)
This question already has answers here:
getting free unit number in fortran
(2 answers)
Closed 7 years ago.
I can write a FORTRAN function to find an available file unit, but I was certain there was already an intrinsic. But if there is, I can't find anything about it. Is there such a thing or am I dreaming?
UPDATE: Apologies for the duplicate. Did a search, but it didn't show up.
I guess, you are looking for newunit (available with F2008, shown at the bottom of that link in the Fortran Wiki).
Ups, has already been answered.
maybe you were thinking of inquire?
This question already has answers here:
How does C compute sin() and other math functions?
(22 answers)
Closed 9 years ago.
Anybody can explain or show how is the function "sin" (or "sinf", "sinl") realized in C.
Intuition suggests that it should be somewhere in the math.h but I did not see anything there
There's a couple ways I can think of right off the bat:
Lookup tables
Approximation via Taylor series (which can be easily made accurate to a number of significant digits).
This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
What is the point of function pointers?
hi all,
I want to get the basic and concrete idea of function pointers in C language.
ie 1) its usage in C
2) main applications it is currently using
3) unique features
4) its scope in embedded applciations etc
Hoping your co operation in this too.
__Kanu
Function Pointers are pointers, that is variables, which point to the address of a function.
Nice example here. Also this answer is a must read.