꧁༒𝐀𝐡𝐦𝐚𝐝༒꧂
yes
꧁༒𝐀𝐡𝐦𝐚𝐝༒꧂
Cant you try it out using a compiler?
No , Please give me answer
꧁༒𝐀𝐡𝐦𝐚𝐝༒꧂
i need answer for it
Anonymous
Just follow your intuition, then write code. No matter how bad or messy it is. If the code terminates with wrong answer, try to solve it. If the code can't be compiled, try to read the compiler message, search it, then solve it. You can learn faster with practicing rather than get ideas from others.
꧁༒𝐀𝐡𝐦𝐚𝐝༒꧂
Anonymous
Why ary name is not included in lvalue expression?
Anonymous
Array *
Anonymous
Why ary name is not included in lvalue expression?
Did you mean why it cant be used as the left hand side of assignment operator? Because array names unless used in specific contexts always decays to a pointer to its first element. This pointer is not an lvalue.
꧁༒𝐀𝐡𝐦𝐚𝐝༒꧂
Okey Use it for my aswer
Anonymous
What is that specific context?
Like when used with sizeof or when using & before an array name or when using alignof
SLDT
Hello need help in creating an alarm clock
SLDT
Just need a clue i have no idea
klimi
SLDT
Okay i have a project,am supposed to make an alarm clock using c++ language
Anonymous
Okay i have a project,am supposed to make an alarm clock using c++ language
Try it urself and paste code here if its not working in any line!
Abhi
How to convert hexadecimal to decimal for beginner programmer in c++??
Ravi
How to convert hexadecimal to decimal for beginner programmer in c++??
Just maintain the alphabetic values like 10 = A , 11 = B, else is the same as other base conversions
Talula
How to convert hexadecimal to decimal for beginner programmer in c++??
https://aticleworld.com/c-program-to-convert-hexadecimal-to-decimal/
Abhi
Is it possible to debug line by line c++ program
Abhi
Or debug is only for big programs
Ravi
simply put cout this line, thats it 😅
Abhi
😅😂👌
klimi
Is it possible to debug line by line c++ program
you can use gdb with the step function
Ravi
😅😂👌
http://www.pythontutor.com/cpp.html#mode=edit You can step by step visualize small codes here.
Abhi
Thnx
Abhi
// C++ program to convert a decimal // number to hexadecimal number #include <iostream> using namespace std; // function to convert decimal to hexadecimal void decToHexa(int n) { // char array to store hexadecimal number char hexaDeciNum[100]; // counter for hexadecimal number array int i = 0; while (n != 0) { // temporary variable to store remainder int temp = 0; // storing remainder in temp variable. temp = n % 16; // check if temp < 10 if (temp < 10) { hexaDeciNum[i] = temp + 48; i++; } else { hexaDeciNum[i] = temp + 55; i++; } n = n / 16; } // printing hexadecimal number array in reverse order for (int j = i - 1; j >= 0; j--) cout << hexaDeciNum[j]; } // Driver program to test above function int main() { int n = 2545; decToHexa(n); return 0; }
olli
Is it possible to debug line by line c++ program
yes, IDEs and editors such as Visual Studio Code allow to step through your code line by line. Otherwise you can use debuggers outside of an Editor, such as WinDbg/GDB/LLDB
Ravi
it should be 65 not the 55
Ravi
48 is ascii of number 0 so, till 57, the first if condition will work
Ravi
In case of larger than 9 value, we should consider A, B so ascii value of A is 65,
Abhi
so when we add integer in char variable it automatically assumes that it is an ascii value
Ravi
so when we add integer in char variable it automatically assumes that it is an ascii value
any integer when it is converted into char, (You are putting integer value into char array, so it is the int to char conversion), it will gain the charactor corresponding to that ascii value
ram
where can i learn more about constructive algorithms
Bilal
Hello, Can someone help me with C please ?
ram
https://codeforces.com/problemset/problem/1537/B
Anonymous
https://codeforces.com/problemset/problem/1537/B
This is just an union find algorithm with path compression. For each node in the union find data structure store the distance from the top level parent in the node. Make sure that this distance is the least distance from the parent. Choose the nodes with the maximum and 2nd maximum distance from the parent node as your answer. The parent node will be the node where Anton is standing btw. If there are multiple answers to the first and 2nd maximum choose the ones that are furthest away from each other in the room.
Ravi
For this question, main purpose is to make anton move maximum, So you can think about what if I throw first yoyo in first cell and 2nd yoyo in last cell. Is there any other case, where you find more steps than this?!
Anonymous
Any book name for c++
Ravi
The room is a 10^9 × 10^9 room. So how exactly is he going to make the guess you suggested?
It's basic understanding, if he can solve maximum of 6 cross 6 square or any other rectangle case, Definately he can get to the point that answer is only 1 liner.
Anonymous
It's basic understanding, if he can solve maximum of 6 cross 6 square or any other rectangle case, Definately he can get to the point that answer is only 1 liner.
I am asking how can he figure that the first ball should be thrown to the 2nd cel and the 2nd ball to the last cell. You asked him to assume this. So I am curious as to how he can decide that this is where the balls must be thrown?
Ravi
I am asking how can he figure that the first ball should be thrown to the 2nd cel and the 2nd ball to the last cell. You asked him to assume this. So I am curious as to how he can decide that this is where the balls must be thrown?
just assume, what is the case where Anton has to travel more, thats it, there is only longest distance which is from a corner to another corner. He has to go to first corner to take the first yoyo and then again u turn, go to the depth of the room that is another corner (Not the neighbouring corner, diagonak corner) Then get back to his position i.e. again U turn.
Ravi
Though there are equal number of steps to travel from one corner to another corner, if anton choose any path between them, thats why I asked to throw yoyo at the first corner, so he must have to travel to both the corner which is the longest,
Anonymous
I am new to coding is he asking to maximise the minimum distance?
Anonymous
just assume, what is the case where Anton has to travel more, thats it, there is only longest distance which is from a corner to another corner. He has to go to first corner to take the first yoyo and then again u turn, go to the depth of the room that is another corner (Not the neighbouring corner, diagonak corner) Then get back to his position i.e. again U turn.
Assume anton is standing in one corner of a square room. Then if I use ur suggestion I will place one ball in the diagonally opposite location and another ball at the end of the other diagonal. Are you sure this is the solution? Think about it. There is a better solution in this case which makes him travel more squares. And I didnt suggest DFS. I suggested Union Find with Path compression which is a lg*n algorithm. It is very fast. It is different from DFS.
Ravi
if antpn is standing in the first corner them also, it will work
Anonymous
it still works, if you place the yo-yo in the opposite corners, Anton has to travel 2n+2m cells no matter where he stands
Aah shit. He cant move diagonally. I thought he could move to any square next to the current square he is on. Since he can move only horizontally or vertically, in this case yes putting it on the diagonal would be the best solution.
Ravi
Which is when union find will help
And that I dont know, 🤧
class Person(Skills): name = str("Ankush Bhagat")
In Shell cat /proc/meminfo | awk NR==2 | awk '{printf $2}' Output : 48796 (my output) And how to get this same output in C
Buck
hello guys! anyone know how to resolve this warning warning: ISO C forbids conditional expr with only one void side [-Wpedantic] on compact if like this: (condition) ? (option one) : (option two); thanks!
Ravi
as one is void and another is int, some kind of such thing must be there in your code. if it is there, you can use traditional if else.
Buck
as one is void and another is int, some kind of such thing must be there in your code. if it is there, you can use traditional if else.
i have (condition) ? fprintf() : my_func(); my_func() is void and the code work well. so, according to what you tell me then the warning I can not solve it (if I understand correctly), right?
AJAY
What is the difference between c and c++
Ravi
What is the difference between c and c++
C is strictly procedural programming language whereas C++ is both procedural and Object Orientez
Ravi
Oriented,