mito
#ot
Thank you.
JY
Sigmask is better
JY
I am receiving some time series data in my project, i found jaguardb database is so cool. It does automatic aggregation of different time windows and i just use them.
Hi
Can anyone give me some ideas on my hw about malloc ? I’ll send a PM to you .🙇‍♂️
Hanz
that present would never attract any helpers
Hanz
instead, send paypal bucks
ninja
😂
.
.
systemQuery
void Bank::account_Holder() { system("cls"); std::cout << "\t\t\tPlease Enter Email Id And Password to Sign In\n" << std::endl; std::cout << "\t\tEmail Id -- > "; std::cin >> email; std::cout << "\n\t\tPassword --> "; std::cin >> password; std::string loginQuery = "select * from new_user where email='" + email + "'and password='" + password + "'"; //std::string loginQuery = "select * from new_user"; std::cout << email << "-----------" << password << std::endl; const char* q2 = loginQuery.c_str(); queryState = mysql_query(conn, q2); std::cout << queryState << "-----------" << std::endl; if (!queryState) { std::cout << "Login Successfull" << std::endl; system("pause"); after_Login(); } else { std::cout << "Login UnSuccessfull" << std::endl; } }
systemQuery
i have made a crud application and after registration, but when i login with wrong email and password it shows successfull login
systemQuery
i dont know where i m wrong in this
Hanz
You only check if queryState is not false
Hanz
perhaps you read what mysql_query returns and check if the result returns exactly 1 rows
Hanz
and format your code with monospace, it sometimes hurt to see unformatted code in the night
systemQuery
on query execution failed it supposed to return 1 but it returns 0 always
Hanz
oh i get it
Hanz
remove the ! on the if statement and test
systemQuery
Now it shows unsuccessful even on correct credentials
systemQuery
Is my query is right Coz it shows right in mysql xampp
Hanz
for real, you need to check mysql_query documentation
systemQuery
Yes int It supposed to return 1 or 0 as per query execution
systemQuery
I have declared it in another class (Bank class)
systemQuery
I Hav declared all variables in bank class
Hanz
oh i see
Hanz
I dont have any idea now, others might help
systemQuery
Ok thank you for ur suggestions
Ahmed
Guys can two functions declare non static variables with the same name?
Ahmed
Does know? my friend is asking me
Ahmed
anyone*
.
Hi
Anonymous
Guys can two functions declare non static variables with the same name?
they can declare 2 static variables with the same name too, they're in different scopes, or I didn't understand your question?
Ahmed
Okay thanks
Ahmed
Guys
Liang
#include <iostream> using namespace std; fOdd(int n){ if(n==0){ return 0; } else if(n>0){ return 3+fOdd(n-1); } } fEven(int n){ if(n==0){ return 0; } else if(n>0){ return 4*fEven(n-1); } } int main() { int n,m,result; cout<<"Please enter the value of n:"; cin>>n; m=n; if(n%2==0){ fEven(m); cout<<fEven(m)<<endl; }else{ fOdd(m); cout<<fOdd(m)<<endl; } return 0; }
Liang
why the output always print 0?
Liang
what do you mean?
Liang
omg
Hanz
function should be at least: type name(args) {body}
Liang
yea
Liang
after adding it, the problem still same
Liang
#include <iostream> using namespace std; int fOdd(int n){ if(n==0){ return 0; } else if(n>0){ return 3+fOdd(n-1); } } int fEven(int n){ if(n==0){ return 0; } else if(n>0){ return 4*fEven(n-1); } } int main() { int n,m,result; cout<<"Please enter the value of n:"; cin>>n; m=n; if(n%2==0){ fEven(m); cout<<fEven(m)<<endl; }else{ fOdd(m); cout<<fOdd(m)<<endl; } return 0; }
Hanz
lemme test
Liang
it is because I havent stop the recursive?
Hanz
Liang
what number you input?
r00ki3
The base case seems wrong for collatz.
Hanz
i get : 1 = 3 2 = 0 3 = 9 4 = 0
r00ki3
It looks like collatz.
Liang
it is mutual recursive
Hanz
if odd ret = i * 3 0 otherwise
Anonymous
ohh kk
Liang
dont understand
Anonymous
just a tip : using bitwise operators to check even/odd is better when the number is quite large
KityaYeanSonn
Anyone Suggest me best app for c program plz
Jan
/get ide
Pavel
Google Benchmark maybe?
This stuff is incredible, super easy to use, thanks again
Hanz
What is that reason 😂
Sai Meghana
Say we have *ptr = 4; print("%d",(*ptr)+++*ptr++); As per my understanding, when we use post increment operator, the value in *ptr increments after the message is printed.. Is that true? Or is it increments after the first ++?
Sai Meghana
Are you saying the code will return an error?
Sai Meghana
Oh okay, gotcha
Anonymous
Say we have *ptr = 4; print("%d",(*ptr)+++*ptr++); As per my understanding, when we use post increment operator, the value in *ptr increments after the message is printed.. Is that true? Or is it increments after the first ++?
all you know is that (*ptr)++ will increment *ptr by 1, and return a right value copy of the original *ptr. the reason it's ub here is because you don't know when it'll happen, but use *ptr twice.
Tanmay
Can someone tell me which programming language would be best for CP?
z
You may get different answer if you ask on Python group. I don't think the best here is objective.
olli
i dont know where i m wrong in this
The query does not fail with wrong credentials, it returns an empty result set. To determine whether a statement returns a result set, call mysql_field_count().
Tanmay
C/C++.
Okay thanks but what if it's between C and C++
Tanmay
I am new to this
Dima
competitive programming
Diego
Ah
Diego
I don't think that makes it any clearer when it comes to knowing what the best language for it is
Diego
But if you ask me it's probably C# If you want to learn how to code, then I'd point you over to Lua to learn programming basics and then probably hop on to the procedural side of C++, and when you get fed up with C++, finally arrive at C#