klimi
oh...
Anonymous
Can we define a function in structure?
Siku T
Hi all
バレンタインがいない柴(食用不可)
Anonymous
b = a+b - (a=b)
is used for swapping
Anonymous
but why isn't the bracket solved first here due to its high precedence
バレンタインがいない柴(食用不可)
バレンタインがいない柴(食用不可)
Which assigns a to be b
バレンタインがいない柴(食用不可)
But a’s value will only be changed after this whole line
Anonymous
Anonymous
If a is assigned to be b then why is it changed later when you have already said that the assignment is done first.
Till
Anonymous
i just started learning c and am stuck in getting the concept of pointers and dynamic arrays and i want someone who can recommed a good book or other sources thank you
Anonymous
Pavel
but why isn't the bracket solved first here due to its high precedence
As far as I understand, its not guaranteed here that a+b or a=b will be calculated first (at least before C++17). So this expression not guaranteed to work the same on all the compilers.
https://en.cppreference.com/w/cpp/language/eval_order
In this case we can parse the expression as a tree (picture below), it's evaluated from top to bottom. We can't evaluate minus before we evaluate both a+b and a=b, but as far as I know the order of these two can be any.
Pavel
Pavel
I can be wrong, though. But I don't see any guarantees about operators specifically.
Also check out this https://stackoverflow.com/questions/1826159/swapping-two-variable-value-without-using-third-variable
rex
Anonymous
.json
rex
2,5
kenny3fcb
oh god..
Anonymous
yoav
void recursionBubble(int* arr, int size, int i, int j, int n){
printf("i = %d n = %d\n", i, n);
if(i >= size / sizeof(int)){
return;
}else{
if(n >= size / sizeof(int))recursionBubble(arr, size, i + 1, 0, 1);
if(arr[n] < arr[j]){
swap(&arr[n], &arr[j]);
recursionBubble(arr, size, i, j + 1, n + 1);
}else{
recursionBubble(arr, size, i, j + 1, n + 1);
}
}
}
yoav
why do i get seg fault
I_Interface
Anonymous
https://www.geeksforgeeks.org/c-language-2-gq/advanced-pointer-c-gq/
Francisco
void recursionBubble(int* arr, int size, int i, int j, int n){
printf("i = %d n = %d\n", i, n);
if(i >= size / sizeof(int)){
return;
}else{
if(n >= size / sizeof(int))recursionBubble(arr, size, i + 1, 0, 1);
if(arr[n] < arr[j]){
swap(&arr[n], &arr[j]);
recursionBubble(arr, size, i, j + 1, n + 1);
}else{
recursionBubble(arr, size, i, j + 1, n + 1);
}
}
}
Why are you dividing by sizeof(int)? It doesn't make sense to me
Francisco
But if it is a pointer, it returns the size of the pointer (probably 8), and if it's an array, it should return the amount of ints
Francisco
So either way, the code is not doing what you think
IceCliffs
I just started C language, is there any place for me to fully learn
Giri
www.google.com
عزة
hi van you give me pdf for exercises cpp.???
I_Interface
Giri
I love all coders
Giri
Gud night
I_Interface
Ak
Ak
klimi
I ban people here
I_Interface
Ak
😂
Ak
.
Anyone knows c++ here?
Artöm
No, this is nodejs chat
Mar!o
Have any of you ever heard of a supercall calling convention? Didnt found anything on goggle! Function was : rax** _supercall setreg(eax***, rbx**) &&;
Artöm
Where did you find this code?
Mar!o
A loosely .cpp file I found in an USB drive from a friend
Anonymous
btw care to explain
&a = end of array address... + 1 = next address after 5 and then -- so it's 5
数学の恋人
/get googleit
Anonymous
How do I use google ?
バレンタインがいない柴(食用不可)
Anonymous
Anonymous
Lol
rex
u r name reminds me of
@rushhour
Tokin
Simply google how to google
Anonymous
How calculated of determinants of matrix in mathematics
Anonymous
Hi can someone help me in a question regard c++?
Anonymous
I send array to a fucntion which spouse to change one value from one of the index, when i print it in the function it works, but when i print it in the main its print me the orignal one
Shree
klimi
Anonymous
https://searchengineland.com/guide/how-to-use-google-to-search
Dima
Ибраги́м
http://www.infocobuild.com/education/audio-video-courses/computer-science/CS61C-Spring2015-Berkeley/lecture-01.html
Ибраги́м
For those that desire going metal
Fathi
Hiii
Anonymous
To
Anonymous
Hi
Anonymous
May I get a complete tutorial on c language for beginners
Anonymous
??
MengShu
#googleit
Sher
Maybe admin(s) should rename this group as C/C++ for advance user and create a new group for newbies. Seriously, not joking here.
Dima
Dima
for indians
Dima