Anonymous
zwy
/get ide
Anonymous
So I found out that the syntax for sizeof is
sizeof unary-expression
sizeof ( type-name )
Why does type name require parentheses? I get that the C standard says so, but does it have a reason, or should I stop asking questions like these and accept the standard for what it is?
Anonymous
Anonymous
Basically saying, using parentheses when the argument is a expression (e.g 10 * int, 50 * double ), and feel free to choose when argument is a variable.
Anonymous
Anonymous
Because the Operator Procedence rule in c.
sizeof is same priority as + unary operator,
so without parentheses compiler will not think 10 * int as a single expression. see
https://www.tutorialspoint.com/cprogramming/c_operators_precedence.htm
Anonymous
I'm not a native English speaks,ples forget my grammar mistaking.
Anonymous
Yes, i'm wrong. thks
Anonymous
np
Anonymous
Anonymous
Vlad
wdym?
Vlad
What do you mean
Anonymous
Pre - Print Root first, Traverse(Left Child), Traverse(Right Child)
In Order - Traverse(Left Child), Print Root, Traverse(Right Child)
Post Order - Traverse(Left Child), Traverse(Right Child), Print Root
Traverse in each case refers to Post Pre or Inorder traversal of each child node respectively
Vlad
Binary tree?
Vlad
Well it's just about where your action's gonna be
Vlad
And how your data is stored and sorted in the BST
Vlad
4
/ \
3 5
Vlad
in order: you go left first, output 3 then 4 and 5
Vlad
pre order: 4, 3, 5
Vlad
post order: 3, 5, 4
Anonymous
For this
Pre will be a b c d
In Order will be d c b a
Post will be d c b a
Stark39377
Can anybody share me resources from where to learn c++ from scratch?
Владислав🇺🇦
Hi everyone. I am wondering when it is a right moment for a C++ developer to switch to LLVM environment. What knowledge should I have before doing it? I tried Clang for some time and I really liked it. Now I am thinking whether I should set up the whole LLVM environment and wouldn't it be a mistake. I use C++ for more than 4 years but I am only a 2nd year student and I have no serious projects in my portfolio (actually asking this question while starting one).
Any advice is much appreciated
Anonymous
Vlad
Vlad
Anonymous
Isn't clang a frontend to llvm?
LLVM refers to the whole set of compiler tool chains and yes clang is one of the front ends among many others for other programming languages. It compiles C++ code to the IR language that is then handled by a common backend toolchain.
Vlad
Vlad
So you were using it all along
Владислав🇺🇦
I guess it will be okay to use it even if the only reason to do so is that I really like the way Clang informs about errors? I may change my mind later on anyway
Vlad
Владислав🇺🇦
Thank you for your response💫
Anonymous
Hello
Anonymous
@Fai0501
Anonymous
Anyone with. Good book on programming for beginners...
Anonymous
Send me kindly
MᏫᎻᎯᎷᎷᎬᎠ
.
Anonymous
Hi, I want to code something to get me to know how many hours I have worked every month, I am beginner just trying something new, should I do it with the console, like typing the values myself or should in try doing a data base? What do you guys think is easier for a beginner? Thanks in advance.
Steven
You can type in the console and store it in a text format
R
#include <stdio.h>
int main(void) {
int m=5;
int num[5]= {12,13,14,15,16};
int i=0;
for(i=5;i>=0;i--)
printf("%d", num[i]
);
return 0;
}
I'm trying to reverse numbers
Can anyone help me what's wrong with my program?
Hanz
olli
Hanz
Oh yeah, didnt see that. Im also wrong 😅
R
佳辉
#include <stdio.h>
float add(float , float);
float sub(float , float);
float mult(float , float);
float div(float , float);
float add(float num1, float num2)
{
return num1+num2;
}
float sub(float num1, float num2)
{
return num1-num2;
}
float mult(float num1, float num2)
{
return num1*num2;
}
float div(float num1, float num2)
{
return num1/num2;
}
佳辉
佳辉
Function declaration?
佳辉
😭i really need help
Anonymous
🙄
R
Sachin
if i declare char str[100] and input str using gets(str) and enter more than 100 characters then try to print str
Sachin
?
Sachin
What will be the output
R
Whats that mean
In the beginning teachers introduced that tool to us
It's computer application
Install it u will understand
佳辉
R
佳辉
Nvm
Anonymous
hey is it possible to access all the members of union at a time?
dipesh
Hey?!
dipesh
Can anyone help me out?
dipesh
I'm confused about return value while using int. Can you explain how does it work when.
Talula
dipesh
And what about the return value. How does it work
Talula
And what about the return value. How does it work
Your question isn't clear, what do you mean "how does it work" do you want to understand how it works in assembly or are you saying how does it work in a very basic understanding of how it works.
dipesh
As We give a return value while using int function. I don't know what does it mean. Can you please explain me
dipesh
I'm learning to use user defined function and while making program with argument and with return value. I'm confused about the return value.
Anonymous
always return 0
Talula
dipesh
I got it. Thanks a lot.
dipesh
Anonymous
in real case error code is not readed, but the output text in stdout - yes