Oluwaseyi
Please I have one off topic on Computer Architecture.... I don't know where to direct this question to... Please I need help
Oluwaseyi
How does pipelining improve performance? What are the limits on how much a processor performance can be improved upon using pipelining?
BinaryByter
How does pipelining improve performance? What are the limits on how much a processor performance can be improved upon using pipelining?
It doesn't improve it better than threads. However, the reason it's popular is that it allows for very modularized programs (gnu-mentality).
BinaryByter
excellent question, btw
Oluwaseyi
Thanks
BinaryByter
the limit for performance is how fast you manage to get your different softwares to work together. if you wait for ages for a message from program 1, it doesn't really improve the efficiency a lot
BinaryByter
(and obviously the CPU clock speed)
Anonymous
I have just read the message and understand. Currently learning C, but just joined to follow the discussion. Thank you for the welcome.
klimi
/warn google paly
Riccardo
Guys how do i pass a const char *v[15] to a function by reference??
Riccardo
I wrote the parameter like that: void Function(const char *v[])
Riccardo
But It doesn't work
Riccardo
I tryed with const char **v[] as parameter and then wrote &v when calling the function
Riccardo
But It doesnt work either
Avezy
https://stackoverflow.com/questions/1106957/passing-an-array-by-reference-in-c
BinaryByter
hope that answers your question
Avezy
Yes
BinaryByter
passing a pointer as reference defeats the purpose
Anonymous
#include<stdio.h> union complex { int rel ,img ; }; void main() { union complex a,b,c; printf("Enter realpart and imaginarypart of complex number a \n"); scanf("%d %d", &a.rel,&a.img); printf("Enter realpart and imaginarypart of complex number b \n"); scanf("%d %d", &b.rel,&b.img); c.rel = a.rel + b.rel; c.img = a.img + b.img; if(c.img>=0) printf("sum of complex numbebrs %d + %di. \n",c.rel,c.img); else printf("sum of complex numbers %d %di \n",c.rel,c.img); c.rel= a.rel*b.rel - a.img*b.img; c.img= a.rel*b.img + b.rel*a.img; if(c.img>=0) printf("mul of complex numbebrs %d + %di",c.rel,c.img); else printf("mul of complex numbers %d %di",c.rel,c.img); }
BinaryByter
use a struct, not a union
BinaryByter
they are fundamentally different
olli
I wrote the parameter like that: void Function(const char *v[])
Arrays are not pointers, but for function the following applies any parameter of array type is adjusted to the corresponding pointer type So you will never pass an array by value, the pointer to the first element is passed by value instead (which is like passing the array by reference). So to pass your char *v[15] you probably want to write eithervoid foo(char** p) or void Foo(char *p[]), which is exactly the same because of the adjusting above. https://godbolt.org/z/2eqUBk To further answer your question, can you share your code please?
Anonymous
Yeah i know
BinaryByter
google what an union is
Anonymous
but I also want to know why it was like that
Riccardo
Thank you for your help and have a great day
Anonymous
Can you help me in multiplication of complex numbers using union
BinaryByter
google what a union is
Anonymous
Any one
BinaryByter
olli, sags ihm
Anonymous
okay
olli
Any one
It does not work since img will always be the same as rel. In fact you are only storing a single value and not two. As @linuxer4fun mentioned you should use a struct instead. A union can at any time store exactly one of the values
BinaryByter
danke ❤️
viral
Hello everyone
viral
I need the Best programming language s/s
olli
I need the Best programming language s/s
The best programming language depends on what you're trying to do
viral
I think C programming
hyp3rbor3ax
I need the Best programming language s/s
https://en.wikipedia.org/wiki/Whitespace_(programming_language)
hyp3rbor3ax
but c/c++ is pretty good too
BinaryByter
I hate that logic
there is no best language
BinaryByter
but C++ does everything
BinaryByter
so use that
MᏫᎻᎯᎷᎷᎬᎠ
C++ is the best one
MᏫᎻᎯᎷᎷᎬᎠ
We use other languages cuz they are easy
MᏫᎻᎯᎷᎷᎬᎠ
Or not time consuming
MᏫᎻᎯᎷᎷᎬᎠ
In terms of
Anything
MᏫᎻᎯᎷᎷᎬᎠ
Game development
MᏫᎻᎯᎷᎷᎬᎠ
OS
Roxifλsz 🇱🇹
In terms of
Performance per effort?
MᏫᎻᎯᎷᎷᎬᎠ
Application
MᏫᎻᎯᎷᎷᎬᎠ
Etc...
Ludovic 'Archivist'
BinaryByter
https://github.com/Wittmaxi/Gerinterpreter
Sanjay Tharagesh
Guys check out my GitHub cpp programs. github.com/sanjaytharagesh31/codestuff It consists of some basic required programs in c++ along with some algorithms and data structures. You can contribute to this repo, it's public and open source Thank you
olli
Anything
I don't think that's right. If you want to develop a prototype of any software, C++ might be Overkill. If you want to teach functional programming, you might better chose different languages. In terms of efficiency, C++ is more efficient than most other languages, but does the customer really care if your, let's say Spotify client is written in C++ and performs 5% faster? The company developing such software does not and the majority of users does neither. In my opinion something can't be best in in each aspect, which every advantages there are disadvantages
MᏫᎻᎯᎷᎷᎬᎠ
That's still my opinion also
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
What other Languages have and C++ don't?
MᏫᎻᎯᎷᎷᎬᎠ
Like python
MᏫᎻᎯᎷᎷᎬᎠ
Nearly 80% of what you are programming on your project is pre-made
olli
Nearly 80% of what you are programming on your project is pre-made
Exactly, some languages offer ABI compatibility, making it really easy to use third-party libraries without the need of recompiling millions of lines.
MᏫᎻᎯᎷᎷᎬᎠ
We can say Other Languages = C++ libraries + API
BinaryByter
What other Languages have and C++ don't?
libraries, paradygms, better compatibility, better standard libary
BinaryByter
there is a HUGE lot
MᏫᎻᎯᎷᎷᎬᎠ
of course not
Ignoring the performance issues