Anonymous
Ehsan
Anonymous
Anonymous
Anonymous
what do you mean?
I mean that compilers have a lot of bugs in C++20 functionality
Anonymous
Anonymous
Ehsan
Anonymous
It can
so I should just use c++17?
what do you think?
Ehsan
C++ modules
yeah I just that cmake doesn’t support c++20 modules now
Anonymous
Ehsan
also alot of libraries use cmake which means you will get affected
Anonymous
Sharique
Ehsan
Anonymous
C++17 is more stable
ok, thanks man. I have one more question for you if that's alright? I asked earlier about QT, QML and integrating them with c++. I'd really appreciate it if you could give me some advice and put me in the right path to learn them. cause I'm really confused.
Anonymous
Anonymous
But there were qmlbook and Qt docs
Anonymous
It should help
Anonymous
Thank you
Anonymous
/ban @Phonice99
Vedant
Anonymous
Vedant
Anonymous
Dima
SAM
Please admin help i want to send a photo of a problem but I can't I don't know why
Nils
Anonymous
Vedant
MAC
Phil
There is the result in the console:
for the polynome -2x^3+5x^2
address : r:34366582840 polynome:34366582808
-6.00 x^ 2 from -2.00 x^ 3
-12.00 x^ 1 from -6.00 x^ 2
-12.00 x^ 0 from -12.00 x^ 1
address : r:34366582840 polynome:34366582808
Phil
I don't understand why the memory is over written
Ehsan
Ehsan
can you put the code here and provide a link?
Phil
https://www.codepile.net/pile/dzRBpJz0
in derv() :
*polynome is overrwritten by *r
Phil
@kyoko687
Ehsan
in which line
Phil
function derv
Phil
114 in for loop
Mihai
use one of these links to share the code:
• https://linkode.org
• https://dpaste.org
• https://pastebin.com
• https://hastebin.com
Phil
sorry all, I didn't realized that it will be sooo long in the chat.. btw I can erase it if you want ?
Ehsan
Ehsan
just provide the link
Phil
@kyoko687 I enable the editing on codepile if needed
Phil
@kyoko687 the commaznd line to run it is
./a.out -2x^3+4x^2-1 derv
Phil
It's really weird I don't understand how this bug happen
Anonymous
Phil
I create for you a new one
Phil
https://www.codepile.net/pile/vNxEdDBQ @dixie_cup
Phil
@kyoko687 I fixed the line 26 for(unsigned int i=1 ...
Phil
Ok so pastebin is okay for you ?
Ehsan
Phil
https://pastebin.com/r4DWYqEM
So there is some update line 26 plus I added some free() but I don"t touch to derv() (where the bug is)
Anonymous
polynome.c:115:45: warning: format specifies type 'unsigned long' but the argument has type 'Monom **' [-Wformat]
printf("address : r:%lu \t polynome:%lu\n",&r->p,&polynome->p);
~~~ ^~~~~
polynome.c:115:51: warning: format specifies type 'unsigned long' but the argument has type 'Monom **' [-Wformat]
printf("address : r:%lu \t polynome:%lu\n",&r->p,&polynome->p);
~~~ ^~~~~~~~~~~~
polynome.c:124:45: warning: format specifies type 'unsigned long' but the argument has type 'Monom **' [-Wformat]
printf("address : r:%lu \t polynome:%lu\n",&r->p,&polynome->p);
~~~ ^~~~~
polynome.c:124:51: warning: format specifies type 'unsigned long' but the argument has type 'Monom **' [-Wformat]
printf("address : r:%lu \t polynome:%lu\n",&r->p,&polynome->p);
~~~ ^~~~~~~~~~~~
4 warnings generated.
Mihai
Phil
This is only for debug it was to look at the addresses it's not important
Phil
you can delete it if you want
Igor🇺🇦
Anonymous
Just compiler warnings, it seems to eval correctly but not do derivatives...
It correctly evals polynomials with duplicate exponents.
Phil
./poly -2x^6+4x^2 derv
fin #:-2x^6:+4x^2#
-12.00 x^ 5 from -2.00 x^ 6
-60.00 x^ 4 from -12.00 x^ 5
-12.00x^5-60.00x^4
Anonymous
Don't overwrite create a new polynomial from the old! free() both when done.
Phil
Phil
For me the bug come from the line 111 :
Polynome *r=(Polynome* ) malloc (sizeof(Polynome));
r->p = (Monom*) malloc(polynome->len);
r->len = polynome->len;
malloc allocate a memory where is already load *polynome
Dark
https://pastebin.com/B4Lv8mZb
code above. i have been having problems with my class when i set the values and then as soon as i run Client.Get("/") it shows the values are not what they were before. because when i call httplib::Client cli("http://google.com") it works and shows the values ip, hostname and port but as soon as i run cli.Get("/") this values have changed and well i am not best at classes but i really don't know why. they should be the same as they were when i set them with the first command
Ehsan
Ehsan
sorry I can’t debug it the code is too messy for me
Ehsan
half the time I am trying to decipher what you are doing which is not good code practice 🙂
Anonymous
I would use Horner's method for polynomials but sparse lists is a valid technique also.
These lists also handle duplicate exponents.
Ehsan
Ehsan
before you entered derv the parse was incorrect
Ehsan
check out how you parsed the string and try again
Ehsan
Polynome *a = poly_write(formating(argv[1]));
for(unsigned int i = 0; i < 3; i++){
printf("%d %f\n", a->p[i].m, a->p[i].e);
}