Phil
3 -2.000000 2 4.000000 721433438 -1.000000
could you give me the context please
Phil
did you took the last update with the line 22 for(unsigned in i=1 ...
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); }
I was skeptic about you trying to parse the string of the polynomial, so I added a simple printf statement and what do you know? The parse is not correct
Ehsan
did you took the last update with the line 22 for(unsigned in i=1 ...
it’s not the problem, you need to fix the code of polywrite
Phil
what did you enter in args ?
Ehsan
your problem is probably in line 41 the while loop
Ehsan
you need to add a condition to check if ther’s actually an x 🙂
Phil
are you sure that this will correct the bug ??
Phil
Everything works if you use a->len
Phil
Ok i got something : -2.000000 6 ///polynome->p[0] 4.000000 2 ///polynome->p[1] 4.000000 2 ///r->p[0] 0.000000 0 ///r->p[1] r->p[0] is connected to polynome->p[1]
Ehsan
https://www.gnu.org/prep/standards/html_node/Formatting.html#Formatting this is good code style standards follow them as much as you can
Ehsan
I know you can do it by yourself it’s simple
Phil
ok I'll try that
Ehsan
https://users.ece.cmu.edu/~eno/coding/CCodingStandard.html#names Also this will help you in the future
Phil
I just showed you the problem, you just need to check if there’s an x so you can parse it correctly that’s it
Ok I just did it and the problem persist if(strchr(token,'x')==NULL) continue; I put it in poly_write() in the while
Ehsan
Ok I just did it and the problem persist if(strchr(token,'x')==NULL) continue; I put it in poly_write() in the while
I am busy now. I will tell you what to do and the problems that you might face: you try to parse with x in mind, this could get undefined behavior so fix it the problem that you might also face is that you didn’t account for the missing monomials(i.e. cx^n where c is zero) so you need to account that 🙂
Ehsan
good luck
Phil
but I made tests and when I have Ax^B if A is missing it gives me 0
Phil
Ok I understand that you must go, thank you for all
Ehsan
good luck
I said “you might”. If you know it’s working then great
Phil
I just checked in the man and it's specified to return Zero if doesn't found
Anonymous
We could rewrite the parsing, but wasn't the parsing already working? It does print in a different style when exponents are out of order BTW.
Phil
-2.000000 6 34362146824 34362146828 polynome 4.000000 2 34362146832 34362146836 polynome 4.000000 2 34362146832 34362146836 r 0.000000 0 34362146840 34362146844 r the col 1 & 2 are values and the col 3&4 are addresses
Phil
you can see that r->p[0] is connecting to polynome->p[0]
Phil
Ok I finally solved that by assigning manually the address in derv() : Polynome *r=(Polynome* ) malloc(sizeof(Polynome)); r->p = &polynome->p[polynome->len] ; //r->p = (Monom*) malloc(polynome->len); r->len = polynome->len;
Phil
I don't know if this is consider as acceptable
Phil
maybe I'll add an realloc to have enough space
robherc
Yes
Which one?
Anonymous
maybe I'll add an realloc to have enough space
I made a version too, it could still use some work... https://pastebin.com/zR05FBpD Oops, it fails to take derivative of a constant! Oops, the parsing doesn't account for implied coefficient +/- one. Oops, it prints unnecessary exponent on power of one terms.
Anonymous
Streams in C++ what does it mean?
Igor🇺🇦
Streams in C++ what does it mean?
https://www.programiz.com/cpp-programming/library-function/iostream
Anonymous
hi guys please i need a c++ programmer for a simple task it doesn't take more than 30minutes and paid of course
Anonymous
guys anyone who have c++ questions please
Anonymous
I got a question: In C++ after setting a stream's output field width, how do you reset it to default?
Anonymous
Nevermind, this explained it. C++ output is still frustratingly awkward. https://www.geeksforgeeks.org/stdsetbase-stdsetw-stdsetfill-in-cpp/
labyrinth
when using gtest in c++
Mahdi
Hi. I wanted the C libraries to have a site you know.
labyrinth
is it normal to see " namespace has no member {Return,DoAll,SetArgPointee}"
Mahdi
Friends help thank you
Anonymous
Mahdi
I wanted the C libraries. I want to know how many libraries he has.
Mahdi
What for?
To do the job
Anonymous
To do the job
What job?
Mahdi
What job?
By the way, what can I do with the C.
Anonymous
Anonymous
But learn English first
Mahdi
Like what
Anonymous
Like what
Every Thing
Mahdi
But learn English first
Yeah, my English is a little weak. sorry.
Mahdi
Anyone with C++ android app iOS wrote
Mahdi
؟؟
Anonymous
؟؟
/warn PMing
Pavel
Anyone with C++ android app iOS wrote
Tl;dr people don't answer questions that asked this way
Mahdi
Pavel
There are some people who did write iOS apps using C. Is it the answer you wanted?
Imtiaz
/get cbook
Mahdi
ios apps
Pavel
What about C++
Many of iOS apps are written in C++
Mahdi
Many of iOS apps are written in C++
Okay, thanks for the tutorial.
Mahdi
For C and c++ training
Mahdi
Help friends
Vlad
We won't help you if we don't comprehend what on earth are you saying which is the case
Ehsan
Help friends
go to a group with your languuage
Mahdi
Pavel
I need training🥺🥺
Find some cources on the internet. If you have specific questions about C/C++ we can answer them, just be specific (and read about how to ask good questions). If you want to find a tutor, there are some websites where you can find one (again, google it).
Mihai
I need training🥺🥺
don't expect people to be your teacher, start learning by yourself, searching on google, wikipedia and youtube.