Anonymous
What cause this
Learning to program is a long journey that never ends its need lots of Patience. We all need everything fast ,That's the problem and lazyness, traped in social media
klimi
Anonymous
Can u suggest best channel for latest tech news
Anonymous
Anonymous
Using NetBeans
Babarinde
Anonymous
Anonymous
Anonymous
Anonymous
Anonymous
Anonymous
Anonymous
Anonymous
Like this create frames get information store it in database retrieve it
Anonymous
Thanks
Anonymous
I'll talk to my teacher and then inform you
Anonymous
Thanks for helping me
Anonymous
Aadarshhh
#include<stdio.h>
#include<stdlib.h>
int* compareTriplets(int a_count, int* a, int b_count, int* b, int* result_count) {
*result_count = 2;
int *result;
result= malloc(2* sizeof(int));
int alice =0;
int bob =0;
for(int i =0;i <3;i++){
if(*(a+i) > *(b+i)){
*(result+i) = alice +1;
alice ++;
}
else if(*(a+i) < *(b+i)){
*(result+i) = bob + 1;
bob ++;
}
else{
continue;
}
return result;
}
}
int main(int argc, char const *argv[])
{
int *a;
a = malloc(3 * sizeof(int));
int *b;
b = malloc(3 * sizeof(int));
int a_count = 3;
printf("Enter alice score : \n");
for (int i = 0; i < a_count; i++)
{
scanf("%d",& *(a+i));
}
int b_count = 3;
printf("Enter Bob score : \n");
for (int i = 0; i < b_count; i++)
{
scanf("%d",& *(b+i));
}
int result_count;
int *result = compareTriplets(a_count, a, b_count, b, &result_count);
for (int i = 0; i <result_count; i++)
{
printf("%d",*(result+i));
printf(" ");
}
printf("\n");
return 0;
}
Aadarshhh
can you guys pint out where is the mistake
Aadarshhh
concept is : input 3 values of alice and bob ; if alex > bob then alex get one points and vice versa
Aadarshhh
total points of alex and bob is printed on array
Aadarshhh
at least look at the syntax
Aadarshhh
something is missing with my pointers
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
Not copy paste the whole code file
MᏫᎻᎯᎷᎷᎬᎠ
Or just send part of your code
Anonymous
What error u getting
MᏫᎻᎯᎷᎷᎬᎠ
Or google the Meaning of your compiler error messages
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
/rules
Anonymous
/rules
MᏫᎻᎯᎷᎷᎬᎠ
I did that at the first time
Aadarshhh
Enter alice score :
1
2
3
Enter Bob score :
3
2
1
1 0
Aadarshhh
this is the output I got
Aadarshhh
but actually I should get 1 1
Aadarshhh
because Alice wins 1 and bob wins 1 time in score
Stefan
https://seclists.org/oss-sec/2019/q1/119
Stefan
very serious exploit, consult your devops now
klimi
Ибраги́м
C++ Weekly - Ep 154 - One Simple Trick For Reducing Code Bloat
https://www.youtube.com/attribution_link?a=x-6ytcOf5Js&u=%2Fwatch%3Fv%3DD8eCPl2zit4%26feature%3Dshare
https://redd.it/apj6bu
@r_cpp
Nehemiah Aklil
guys can any one tell me how I can compare values in an array for example find reapted values or check if they are even or odd
Nehemiah Aklil
Anonymous
Compare a[i] and a[i+1]
Stefan
Sharry
Hello, how can I get Maple software without purchasing it?
Francisco
The compiler will optimize those operations anyway
Francisco
Don't play to be smarter than the compiler
Francisco
But we are not talking about non-trivial types, I think
Francisco
In your code, T is only required to have operator*
klimi
Francisco
And n is an int, which the compiler knows how to optimize
Anonymous
Anonymous
Via objects? Or if private .. Via a function ?
Nicola
how to generate a number prime random way
Francisco
Nehemiah Aklil
😐😐😐wat is this
Francisco
Francisco
The primality function is quite optimize (even parallelized), but you could use your own
Nicola
int genPrimeNumber(){
int f_index= 127;
srand (time(NULL));
int num,d=0;
while(d==0){
num=rand()+f_index;
for(int i=2;i<num;i++){
d=num%i;
if(d==0) break;
}
}
return num;
}
Francisco
klimi
klimi
i mean the output
klimi
im no expert tho...
klimi
Nicola
Francisco
Sorry, that's because of the iostream header (which shouldn't be there). There's no assembly as it's full templates
klimi
oh...
Francisco
Thanks!
If you need it in C, it won't work for you
Francisco
oh...
Yeah, templates don't generate any assembly code
klimi
okay
Anonymous
Library? Windows.h? ?
Nicola
I have to realize RSA and then generate two causal prime numbers but using srand (time (null)) the two generated numbers are equal
Vitaliy ◀️TriΔng3l▶️
srand(time(nullptr));
Sleep(rand() & something);
srand(time(nullptr));
🤷♂️ 🤦♂️