Ilya
https://pastebin.com/fFQ1mSaq
Where is this / in the code?
Anonymous
look good
Ilya
look good
valore2=(valore1)/(2.0); I see only this
Anonymous
ah okay
Anonymous
I have tried also with (float) valore 1 /2
Anonymous
but it does not work
Ilya
but it does not work
It must work. How do you detect that it doesn't?
Anonymous
the program not works
Francisco
the program not works
What do you get and what should you get?
Anonymous
Anonymous
dev c*++
András
I see only Valore2 = valore1/2 Printf(valore1)
András
cmd
I mean which part of the code
András
So its always 1
Anonymous
https://pastebin.com/yWXfw2qP
András
https://pastebin.com/yWXfw2qP
Which line doesn't work?
Rizesky
change your printf on division part
Anonymous
24
András
24
But you print valore1. Not valore2
András
So?
András
but it not work
How do you know it? By printing valore1, while result is stored in valero2?
Javi
but it not work
If you print valore1, you'll never get whatever value divided by 1.1
András
but it not work
What are you printing in 25 line?
Anonymous
valore 2
András
Are you sure?
Javi
valore 2
No, you aren't
Anonymous
the programs works
Anonymous
thanks
Anonymous
I declared doblue and not float
rex
Find sub-matrix with the given sum Given an N x N matrix and two integers S and K, the task is to find whether there exists a K x K sub-matrix with sum equal to S.
rex
that is the full code i copied from the site
rex
except some comment lines
Ludovic 'Archivist'
Hi you were correct, new expression decays arrays to pointer, fuck! I'm disappointed. BUT this is not related to the code snippet, actually, because there was no arrays originally and both pointers and references would starve from array to pointer decay similarly.
The issue I have with the original snippet is that even tho it is syntactically correct it is not semantically correct, it doesn't mean to a human what you would expect it to mean, as, alone, I means that the allocated value is not owned by the function (it is a reference)
Ludovic 'Archivist'
For owning, we must use smart pointers
And here who owns the value?
Ludovic 'Archivist'
Casper the ghost? Mahatma Buddha? The holy spirit? Kirito the over-edgy swordman?
Ludovic 'Archivist'
I will tell you who owns that pointer removed reference, it is the Illuminati and the freemasons that have shared ownership of it
Ilya
And here who owns the value?
This is unknown. As it would be with pointer instead of reference
Ludovic 'Archivist'
This is unknown. As it would be with pointer instead of reference
And you don't want to handle responsibilities of ownership like that anywhere
Cedar
群里有中国人吗
Anonymous
群里有中国人吗
/warn it's English only group
Cedar
I see
Cedar
Is there anyone know someone ms cs project in USA with full scholarship?
Magician
what's that ?
M
Guys how to allocate a stack in c ?
Ilya
Guys how to allocate a stack in c ?
what do you mean by stack? the data structure or machine memory area used to call functions?
Ilya
Yes
Question: 1 or 2 ? Answer: YES!
M
As u like
Ilya
Guys how to allocate a stack in c ?
I then will answer: "Somethow"
Anonymous
lol
Anonymous
As u like
Your english is so good :D
M
Your english is so good :D
Thanks for the compliment
Anonymous
I suggest you: - First learn English - Second learn the C programming language
Ilya
Thanks for the compliment
Will you please answer my question?
Anonymous
even if you learn to program in C language, you willl need english for everything else
Anonymous
M
I mean the data structure
Ilya
I mean the data structure
ok, I see, There is NO standard data structures like Vector List, etc , including stack, in the standard library of C, so you cannot create stack. There are 3 options you can find some (non-standard) library for C, implementing stack you can write your own implementation or You can use C++ and std::stack
Bennie
It is on the same level of cleverness as volatile int f() { return 4; }
The code here should read: int f() volatile { ... } For c++ functions it can for the most compilers only appear on member functions and not standalone functions. Volatile on a member function is meant to tell the compiler no optimizations on the function and the object it is declared/defined in because the code can be called from outside the app execution context at runtime... If you wanted const just use it, do not try to be smart, it will only make life difficult for yourself.
Ludovic 'Archivist'
Volatile is mostly made to operate with memory mapped IO and interfaces
Bennie
optimizations
Ludovic 'Archivist'
Read your compiler docs... volatile disables all ootimizations
That is a possible side effect, not the semantic of volatile. Compilers are free to optimize code around a volatile given that they do not reorder or omit volatile reads or write
Ludovic 'Archivist'
I've worked 26 years on c/c++ - no need for the std
You say that but it appears you are a complete ignorant of the goal of cv qualifiers