Ryder
Please 🙏 I just wanna know more...though the question might sound stupid: What's the difference between gui programming and windows programming?
gui is adding the user interface.. like which someone can tap and an action is executed, the opposite of this is CLI. as for windows programming, I don't know what that is
J
What do you mean by windows programming?
To be sincere, I'm confused to say the only thing I know about it is that it's programming applications for windows..but then I ask how does this relates to software applications...now this is very stupid a question, I know. But would love to see anyone who would assume to answer this newbie who wants to know as he's confused
Andrew
Software and application are sinonyms
J
Software and application are sinonyms
Ok...let me reframe the question this way to see if I'll get it. Is microsoft word a GUI application or windows application.....or is it both???...sorry it might look stupid, just try and help me out to clarify
Anonymous
Hii
Anonymous
Hii
user bot ?
Anonymous
Ok😁....so is it also a gui?
A windows app might be cli. A non -windows app can have a gui. That is not related
Arjun
Guys is there any project ideas that a beginner can pull it off using c++
Anonymous
Hi
Anonymous
Hi
Bye
klimi
user bot ?
Probably
klimi
Hi
Don't write just "Hi" here, thank you
Pavel
Guys is there any project ideas that a beginner can pull it off using c++
Depends on what you want to learn. As simple but interesting things, you can do a small game, like tic-tac-toe or chess, or you can write a TCP chat (client and server)
Hmaada
hello guys i would like to to creat a thread function of an int function is it possible or it must absolutly be a void function?
Anonymous
double n,k,sum=0.0; cin >> n; for (int i=1; i<=n; i++) { cin >> k; sum += k; } cout << fixed << setprecision(12) << sum/n << endl; Can anybody explain the meaning of cout << fixed << setprecision(12) << sum/n << endl;
Pavel
double n,k,sum=0.0; cin >> n; for (int i=1; i<=n; i++) { cin >> k; sum += k; } cout << fixed << setprecision(12) << sum/n << endl; Can anybody explain the meaning of cout << fixed << setprecision(12) << sum/n << endl;
First of all, don't use using namespace std; std::fixed https://en.cppreference.com/w/cpp/io/manip/fixed std::setprecision https://en.cppreference.com/w/cpp/io/manip/setprecision std::endl https://en.cppreference.com/w/cpp/io/manip/endl It sets the stream to print floats with fixed point notation, with the given precision. Then sends result of sum / n to the stream, then sends std::endl which adds a line break and flushes the output stream. Look at the examples by the first link.
Anonymous
Hmaada
You can run a nonvoid function in a thread, you just won't have the retval.
ah oké thanks finally i changed things in my function to transforme it to void but initialy it took multiple arguments so for passing multiple arguments into creat_threads i had to creat a struct but the problem now is how to call this struct into my function for taking the arguments my struct is something like this: typedef struct a { int v;} aa and my function: void func( void *arg){....}
Anonymous
🥺please someone should help with a greatest interger program in C
Anonymous
🙏🙏🙏a program dat finds the greatest integer...
Anonymous
Noo
Anonymous
Greatest interger function..am sure it uses floor function
Anonymous
🙏 please Google search it...helpp please
Anonymous
Am a beginner please
Anonymous
😭😔
Anonymous
Vlad
😭😔
Don't be a whiny binch please
Anonymous
Okay
Vlad
Yeah
What behavior are you trying to achieve?
Vlad
2.1 would give 3?
Vlad
Please don't pm me lmao
Vlad
Sure
Then ceil is the way to go
Vlad
it's within math.h
Anonymous
em lost
Vlad
https://en.cppreference.com/w/cpp/numeric/math/ceil
Anonymous
Sure
/warn PMing, not able to Google
Janko Ⓥ
Software and application are sinonyms
Applications are applicative software
Anonymous
hello guys i would like to to creat a thread function of an int function is it possible or it must absolutly be a void function?
Which thread manager library did you use? normally with the STL Thread you have: 1- std::thread 2- std::future 3- std::packaged_task 4- std::promise 5- std::async An example with std::future: https://wandbox.org/permlink/MygNVykN2ZJKoQaH
Anonymous
Hello I've got a problem with my code
Janko Ⓥ
Anonymous
I will
Anonymous
#include <iostream> using namespace std; int a,b,c; void numberMaths(int a,int b) { char operation; cout<<"Enter first and second number\n"; cin>>a; cin>>b; int c1=a+b ; int c2=a-b ; int c3=a*b ; int c4=a/b ; switch(operation) { case '+': cout << c1 << endl ; break; case '-': cout << c2 << endl ; break; case '*': cout << c3 << endl ; break; case '/': cout << c4 << endl ; break; default: cout << "I don't know" << endl ; } } int main() { numberMaths(int a,int b) ; cout <<"I've done all that I can to help you ."<< endl ; return 0 ; }
Anonymous
I saw that it could work on code blocks so when I tried it it just wouldn't work
Anonymous
It keeps saying "Expected primary expression before 'int' "
Anonymous
I think I made a dumb mistake though
Alexey
void numberMaths(int a, int b, char operation)
Alexey
a = 30; b = 20; numberMaths(a, b, '+');
Anonymous
Though if is declared inside the numberMaths function doesn't it make no difference
Anonymous
?
Anonymous
What does primary expression mean though?
Pasolino 🛰
Hi. Does someone know a program similar to ngrok, but that can use UDP Ports?
fake
I think I made a dumb mistake though
guys, Your code is confused. (1) a,b seems like global variable, but you reuse them in function as formal parameters, That's not good. (2) In the main() function, you want to use numberMaths(...), but you give it formal parameters except actual parameter.
Alfredo
Hello. I am writing code for an Arduino using the great Stack Overflow Driven Development methodology and some random searches. Now, I have a question that I am not finding an answer because it is a little more of the “how to approach this” kind, rather than “how to do this”. I have a function that spits a json status out of the IP/Ethernet port. Now this program has grown to the point where I need this status report to be selective. I therefore plan to add a parameter to the function to tell it which variables to include in its json status report. The classic way of doing this, I believe, is a bitwise OR of a bunch of bit constants, so that I could for instance call my function like: statusReport(EthernetClient c, REPORT_TEMP1 | REPORT_TEMP2); or perhaps: statusReport(EthernetClient c, REPORT_ALL); Inside the function I would do something like: if ( requestedStatus & REPORT_TEMP1 ) { doc[“… } // Add to the json doc the temperature for sensor 1 Now my question is, would this approach be the most recommended for this environment (micro controller, C++) or would any other approach have any advantage in legibility, code size, efficiency or any other I haven’t considered? Thanks for any inspiration you may want to share.
J
#include <iostream> using namespace std; int a,b,c; void numberMaths(int a,int b) { char operation; cout<<"Enter first and second number\n"; cin>>a; cin>>b; int c1=a+b ; int c2=a-b ; int c3=a*b ; int c4=a/b ; switch(operation) { case '+': cout << c1 << endl ; break; case '-': cout << c2 << endl ; break; case '*': cout << c3 << endl ; break; case '/': cout << c4 << endl ; break; default: cout << "I don't know" << endl ; } } int main() { numberMaths(int a,int b) ; cout <<"I've done all that I can to help you ."<< endl ; return 0 ; }
#include <iostream> using namespace std; void numberMaths(int a,int b) { char operation; cout<<"Enter first number: "; cin>>a; cout<<"Enter second number: "; cin>>b; int c1=a+b ; int c2=a-b ; int c3=a*b ; int c4=a/b ; cout>>"What operation do you want to perform: "; cin>>operation; switch(operation) { case '+': cout << c1 << endl ; break; case '-': cout << c2 << endl ; break; case '*': cout << c3 << endl ; break; case '/': cout << c4 << endl ; break; default: cout << "I don't know" << endl ; } } int main() { numberMaths(int a,int b) ; cout <<"I've done all that I can to help you ."<< endl ; return 0 ; } /*Try compile your program with this source code, think it solves your problem. And one thing to note is that when you're starting out, keep everything simple, you don't want to act like you know it by doing it complex and then causing bugs you can't solve. I think the problem from your own source code is that it never asks the user for the kind of operation it wants to perform by asking him to enter an operator. So try this out and give us your feedback*/
J
Thanks a lot though
#include <iostream> using namespace std; void numberMaths(int a,int b) { char operation; cout<<"Enter first number: "; cin>>a; cout<<"Enter second number: "; cin>>b; int c1=a+b ; int c2=a-b ; int c3=a*b ; int c4=a/b ; cout>>"What operation do you want to perform: "; cin>>operation; switch(operation) { case '+': cout <<a<<" "<<operation<<b<<" = "<<c1<< endl ; break; case '-': cout <<a<<" "<<operation<<b<<" = "<<c2<< endl ; break; case '*': cout <<a<<" "<<operation<<b<<" = "<<c3<< endl ; break; case '/': cout <<a<<" "<<operation<<b<<" = "<<c4<< endl ; break; default: cout << "I don't know" << endl ; } } int main() { numberMaths(int a,int b) ; cout <<"I've done all that I can to help you ."<< endl ; return 0 ; } /*Try compile your program with this source code, think it solves your problem. And one thing to note is that when you're starting out, keep everything simple, you don't want to act like you know it by doing it complex and then causing bugs you can't solve. I think the problem from your own source code is that it never asks the user for the kind of operation it wants to perform by asking him to enter an operator. So try this out and give us your feedback. Their might be typo errors, solve them wisely😁*/
Rakesh
Hello, Can anyone suggest me some resource for learn c language as a beginner?
Anonymous
#include <iostream> using namespace std; void numberMaths(int a,int b) { char operation; cout<<"Enter first number: "; cin>>a; cout<<"Enter second number: "; cin>>b; int c1=a+b ; int c2=a-b ; int c3=a*b ; int c4=a/b ; cout>>"What operation do you want to perform: "; cin>>operation; switch(operation) { case '+': cout <<a<<" "<<operation<<b<<" = "<<c1<< endl ; break; case '-': cout <<a<<" "<<operation<<b<<" = "<<c2<< endl ; break; case '*': cout <<a<<" "<<operation<<b<<" = "<<c3<< endl ; break; case '/': cout <<a<<" "<<operation<<b<<" = "<<c4<< endl ; break; default: cout << "I don't know" << endl ; } } int main() { numberMaths(int a,int b) ; cout <<"I've done all that I can to help you ."<< endl ; return 0 ; } /*Try compile your program with this source code, think it solves your problem. And one thing to note is that when you're starting out, keep everything simple, you don't want to act like you know it by doing it complex and then causing bugs you can't solve. I think the problem from your own source code is that it never asks the user for the kind of operation it wants to perform by asking him to enter an operator. So try this out and give us your feedback. Their might be typo errors, solve them wisely😁*/
I think it's my compiler but it gave me a lot of errors
J
Yeah I always try to do it the hardest way to make sure I get it
Doing it the hardest way isn't bad. But when you're a beginner you want to solve the problem first. Then after solving it, go on to see how you can tweak the code to make sure it's more advanced. Though has Bjarne Stroustrup put it: "Complexity is the enemy of maintainability". So do it wisely
Anonymous
I think it's my compiler but it gave me a lot of errors
Yeah it was the compiler's problem. Sorry if that uneased you
J
#include <iostream> using namespace std; void numberMaths(int a,int b) { char operation; cout<<"Enter first number: "; cin>>a; cout<<"Enter second number: "; cin>>b; int c1=a+b ; int c2=a-b ; int c3=a*b ; int c4=a/b ; cout>>"What operation do you want to perform: "; cin>>operation; switch(operation) { case '+': cout <<a<<" "<<operation<<b<<" = "<<c1<< endl ; break; case '-': cout <<a<<" "<<operation<<b<<" = "<<c2<< endl ; break; case '*': cout <<a<<" "<<operation<<b<<" = "<<c3<< endl ; break; case '/': cout <<a<<" "<<operation<<b<<" = "<<c4<< endl ; break; default: cout << "I don't know" << endl ; } } int main() { numberMaths(int a,int b) ; cout <<"I've done all that I can to help you ."<< endl ; return 0 ; } /*Try compile your program with this source code, think it solves your problem. And one thing to note is that when you're starting out, keep everything simple, you don't want to act like you know it by doing it complex and then causing bugs you can't solve. I think the problem from your own source code is that it never asks the user for the kind of operation it wants to perform by asking him to enter an operator. So try this out and give us your feedback. Their might be typo errors, solve them wisely😁*/
This one here adds more information to the code, so u can also try it out