Anonymous
M.Khorram
Anonymous
Nitesh
Anonymous
They are both very good.
Nitesh
M.Khorram
have installed in from online repository?
(I install the offline version)
Nitesh
Nitesh
From where can I get the offline version??
Mohsen
hey guys, I declared an array and a pointer globaly
now I can assign the address of the array like below when I do it Under main() :
ptr = array ;
but if I want to do that assignment globaly too, I should do it this way :
int * ptr = array ;
what's the reason ?
M.Khorram
Nitesh
Nitesh
I'll keep it in mind 😊.
M.Khorram
I'll keep it in mind 😊.
you can google "qt offline installer", the first result would be this one:
https://www.qt.io/offline-installers
Nitesh
M.Khorram
I'll keep it in mind 😊.
note that you don't need offline installer until you don't need to install it multiple times
M.Khorram
Nitesh
Don Peter Joseph
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
struct poly{
int coeff;
int exp;
}*p1,*p2,*p3;
main(){
int n1,n2,n3,i,j=0,k=0;
printf("enter the no of terms of two polynomials:");
scanf("%d%d",&n1,&n2);
p1=(struct poly*)malloc(n1*sizeof(struct poly));
p2=(struct poly*)malloc(n2*sizeof(struct poly));
printf("enter the total no of different exponents in the two polynomials:");
scanf("%d",&n3);
p3=(struct poly*)malloc(n3*sizeof(struct poly));
printf("enter the coefficient and exponent of first polynomial in decreasing order of exponents:");
for( i=0;i<n1;i++)
scanf("%d%d",&p1[i].coeff,&p1[i].exp);
printf("enter the coefficient and exponent of second polynomial in decreasing order of exponents:");
for(i=0;i<n2;i++)
scanf("%d%d",&p2[i].coeff,&p2[i].exp);
for(i=0;i<n1&&1<n2;i++){
if(p1[i].exp>p2[j].exp)
{
p3[k].exp=p1[i].exp;
p3[k].coeff=p1[i].coeff;
k++;
}
else if(p1[i].exp<p2[j].exp){
p3[k].exp=p2[j].exp;
p3[k].coeff=p2[j].coeff;
k++;
j++;
}
else{
p3[k].exp=p1[i].exp;
p3[k].coeff=p1[i].coeff+p2[j].coeff;
k++;
j++;
}
}
while(i<n1){
p3[k].coeff=p1[i].coeff;
p3[k].exp=p1[i].exp;
k++;
i++;
}
while(i<n2){
p3[k].coeff=p2[j].coeff;
p3[k].exp=p2[j].exp;
k++;
j++;
}
printf("the resultant polynomial is :");
for(i=0;i<n3;i++){
printf("%d*x^%d ",p3[i].coeff,p3[i].exp);
if(++i<n3)
printf("+");
}
}
Thierry
Ouch
Don Peter Joseph
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
struct poly{
int coeff;
int exp;
}*p1,*p2,*p3;
main(){
int n1,n2,n3,i,j=0,k=0;
printf("enter the no of terms of two polynomials:");
scanf("%d%d",&n1,&n2);
p1=(struct poly*)malloc(n1*sizeof(struct poly));
p2=(struct poly*)malloc(n2*sizeof(struct poly));
printf("enter the total no of different exponents in the two polynomials:");
scanf("%d",&n3);
p3=(struct poly*)malloc(n3*sizeof(struct poly));
printf("enter the coefficient and exponent of first polynomial in decreasing order of exponents:");
for( i=0;i<n1;i++)
scanf("%d%d",&p1[i].coeff,&p1[i].exp);
printf("enter the coefficient and exponent of second polynomial in decreasing order of exponents:");
for(i=0;i<n2;i++)
scanf("%d%d",&p2[i].coeff,&p2[i].exp);
for(i=0;i<n1&&1<n2;i++){
if(p1[i].exp>p2[j].exp)
{
p3[k].exp=p1[i].exp;
p3[k].coeff=p1[i].coeff;
k++;
}
else if(p1[i].exp<p2[j].exp){
p3[k].exp=p2[j].exp;
p3[k].coeff=p2[j].coeff;
k++;
j++;
}
else{
p3[k].exp=p1[i].exp;
p3[k].coeff=p1[i].coeff+p2[j].coeff;
k++;
j++;
}
}
while(i<n1){
p3[k].coeff=p1[i].coeff;
p3[k].exp=p1[i].exp;
k++;
i++;
}
while(i<n2){
p3[k].coeff=p2[j].coeff;
p3[k].exp=p2[j].exp;
k++;
j++;
}
printf("the resultant polynomial is :");
for(i=0;i<n3;i++){
printf("%d*x^%d ",p3[i].coeff,p3[i].exp);
if(++i<n3)
printf("+");
}
}
what is the problem here.i am not getting expected output.addition of polynomials.
Mohsen
I can but have to do it like this :
int * ptr = array ;
take a look at the code below :
#define SIZE 4
int arra[SIZE] = {1,2,3,4} ;
int arrb[SIZE] = {5,6,7,8} ;
int * pta =arra ; // assining arra's address to pointer
int * ptb;
int main(){
ptb = arrb ; //assining arrb's address to pointer
int i;
for ( i = 0; i < SIZE ;i++)
{
printf("%d\n",pta[i]);
}
for ( i = 0; i < SIZE ;i++)
{
printf("%d\n",ptb[i]);
}
Mohsen
aha , got it 👌👍
thanks alot 🙏
Anonymous
Hello, I'm googling for some document that speaks about "mixing standard c++ parallel algorithms with qt5 gui", please can anybody address (help to find, give a link) me?
Anonymous
Do anybody know about mixing standard c++ algorithms and qt5 gui?
Alex
Anonymous
using standard c++ parallel algoritms in a code with gui application without blocking the gui that can run with the main thread... I'm looking for some guide, but without success
Anonymous
I likec++ standard algorithms but how use them with Qt?
Anonymous
Anonymous
yes but, I'm using standard containers, this is not a problem
Anonymous
the problem is run a parallel algorithms from a gui application in qt
Anonymous
for example
Alex
Vlad
Anonymous
std::for_each with parallel executuion policy?)
👍 yes, if I try to have some feedback to update for example a progress bar, the gui results blocked. And I was looking for some document that describe in general what to do in similar cases
Alex
Anonymous
why not? I can update a progress bar in a main thread from a parallel for_each (multiple thread), it could be view in similar manner to update a vector values with a for_each
Alex
you should not block main thread, cause application will be freezed
Anonymous
yes, that's the problems, I'm looking to perform this in safe way? but, 🙁 without success
Alex
Anonymous
mmm, and pass to this thread, for example a lambda with a parallel for_each?
Alex
pass progress bar, or what do you need to update. do not forget to protect shared vars with mutex
Alex
or even do not pass gui elements, do staff in thread and then use QT signal to update gui element
Alex
https://doc.qt.io/qt-5/signalsandslots.html
Anonymous
Anonymous
I will try, many thanks
Anonymous
Help me i want a code
Anonymous
V01D
That is a picture, not a code
V01D
V01D
Roxifλsz 🇱🇹
Anonymous
Print increasing number of spaces, followed by alternating _ and |, followed by newline character
V01D
V01D
Which would look nicer than print print print print
Merazi
V01D
Merazi
V01D
V01D
V01D
Talula
V01D
Nitesh
V01D
Idk who would ever wanna use it, and why.
The entire .NET family is cursed with CLR aka decompilers
Konstantin
Visual Basic.
I believe that was the whole point of "heresy" comment
Talula
VB SUCKS... Even though back in 1996, I started Windows programming using VB... but trust me it SUCKS.
V01D
Hadaward 'Solly'
everyone migrated to C#
Talula
C#
Hadaward 'Solly'
from VB, that is
Anonymous
Anonymous
Do you all really think that .NET is ontopic here?
Z0OM
what happens if i delete a pointer to a structure with no destructor?