Dima
Total crap
Anonymous
Well at least naming is better than posix
Anonymous
You shouldn’t use winapi
How do I code for windows?
Anonymous
Anonymous
How do I code for windows?
What are you trying to code?
Anonymous
What are you trying to code?
Now I'm trying to learn
Anonymous
I mean, learn more advanced stuff, I know the "basics"
Anonymous
Now I'm trying to learn
What's the goal? What kind of apps?
Dima
Well at least naming is better than posix
Yeah... SZ_KEK_A_DWORD_HWND_HNDL_LOL
Anonymous
Anonymous
There's pretty good framework called Qt It's more about GUI apps but you can build console app with this
Anonymous
There's a lot of "abstractions" on OS API
Anonymous
It's crossplatform
Anonymous
Various things
Anonymous
Networking, file system, etc
Anonymous
Wouldn't it be better to know directly the OS API?
Anonymous
When there's no abstractions for that
Anonymous
Because code look cleaner with them
Anonymous
Linked list insertion deletion programs
Anonymous
When there's no abstractions for that
Ok ty, I'll study that one
Anonymous
/warn
Lieutenant
Linked list insertion deletion programs
try learncpp<dot>com to learn the basics of c++. then learn about Linked Lists from geeks for geeks or any book that you want to refer. and tell us if you encounter any doubts!
Anonymous
Hi..Can you help me solve this question?
Lieutenant
Hi..Can you help me solve this question?
copy the message, and paste it here instead. don't forward messages
Anonymous
Anonymous
Do you want us to write a code for you?
Lieutenant
Hi..Can you help me solve this question?
you never told us what problems you were facing while solving this problem
Anonymous
yes
/warn read the rules
Lieutenant
yes
so, you've chosen death
Anonymous
thank you
Tushar Goel
#include<stdio.h> int main() { long int n; scanf("%ld",&n); long int a[10000000]; long int i; for( i=0;i<n;i++) { scanf("%ld",&a[i]); } }
Tushar Goel
guys in this code , compiler compiles the program without taking input from the user
Tushar Goel
Ya so I used long int
Tushar Goel
but still it isn't working
Anonymous
I understood the rules, thank you all
Flamingo 🔒🦩🤏
Hi all I'm not very expert with C, I was looking at the function execvp here i have this code The function takes char *const argv[] but I have const char *args If i try ro modify the struct from the one that i have now to *const args[] the compiler just give up with an internal compiler error
Tushar Goel
Ohh. Actually i dont know what is heap and all
Tushar Goel
can you recommend me a video or something
Tushar Goel
But these are local variable
Tushar Goel
and also only the main()executes
Tushar Goel
Okay sir
Tushar Goel
thank you so much
Anonymous
#include <iostream> #include <fstream> #include <vector> //file contents to vector of vec std::vector<std::vector<int>> f_2_v() { std::ifstream ifs{ "projecteuler" }; if (!ifs) { std::cout << "failed to open file for reading\n"; } std::vector<std::vector<int>> a; int b; while (!ifs.eof()) { std::vector<int> temp{}; for (int j = 0; j < 20; j++) { ifs >> b; temp.push_back(b); } a.push_back(temp); } return a; } int right(const std::vector<std::vector<int>>& d) { int curr_prod = 0; int prev_prod = 0; for (int i = 0; i < 20; i++) { for (int j = 0; j < 17; j++) { curr_prod = d[i][j] * d[i][j + 1] * d[i][j + 2] * d[i][j + 3]; if (prev_prod < curr_prod) { prev_prod = curr_prod; } //std::cout << prev_prod << '\n'; } } return prev_prod; } int upw(const std::vector<std::vector<int>>& d) { int curr_prod = 0; int prev_prod = 0; for (int i = 0; i < 17; i++) { for (int j = 0; j < 20; j++) { curr_prod = d[i][j] * d[i + 1][j] * d[i + 2][j] * d[i + 3][j]; if (prev_prod < curr_prod) { prev_prod = curr_prod; } //std::cout << prev_prod << '\n'; } } return prev_prod; } int diag(const std::vector<std::vector<int>>& d) { int curr_prod = 0; int prev_prod = 0; for (int i = 0; i < 17; i++) { for (int j = 0; j < 17; j++) { curr_prod = d[i][j] * d[i + 1][j + 1] * d[i + 2][j + 2] * d[i + 3][j + 3]; //std::cout << curr_prod << '\n'; if (curr_prod > prev_prod) { prev_prod = curr_prod; } } } return prev_prod; } int main() { std::vector<std::vector<int>> d; d = f_2_v(); /* for (int i= 0; i < 20; i++) { std::cout << i <<" : "; for (int j = 0; j < 20; j++) { std::cout << d[i][j] << " "; } std::cout << '\n'; }*/ std::cout << right(d) << " "; std::cout << upw(d) << '\n'; std::cout << diag(d); }
Anonymous
I am not getting the answer to the problem
Anonymous
I dont know what exactly is wrong
Anonymous
this is from project euler #11
Dong
no
Flamingo 🔒🦩🤏
#include <iostream> #include <fstream> #include <vector> //file contents to vector of vec std::vector<std::vector<int>> f_2_v() { std::ifstream ifs{ "projecteuler" }; if (!ifs) { std::cout << "failed to open file for reading\n"; } std::vector<std::vector<int>> a; int b; while (!ifs.eof()) { std::vector<int> temp{}; for (int j = 0; j < 20; j++) { ifs >> b; temp.push_back(b); } a.push_back(temp); } return a; } int right(const std::vector<std::vector<int>>& d) { int curr_prod = 0; int prev_prod = 0; for (int i = 0; i < 20; i++) { for (int j = 0; j < 17; j++) { curr_prod = d[i][j] * d[i][j + 1] * d[i][j + 2] * d[i][j + 3]; if (prev_prod < curr_prod) { prev_prod = curr_prod; } //std::cout << prev_prod << '\n'; } } return prev_prod; } int upw(const std::vector<std::vector<int>>& d) { int curr_prod = 0; int prev_prod = 0; for (int i = 0; i < 17; i++) { for (int j = 0; j < 20; j++) { curr_prod = d[i][j] * d[i + 1][j] * d[i + 2][j] * d[i + 3][j]; if (prev_prod < curr_prod) { prev_prod = curr_prod; } //std::cout << prev_prod << '\n'; } } return prev_prod; } int diag(const std::vector<std::vector<int>>& d) { int curr_prod = 0; int prev_prod = 0; for (int i = 0; i < 17; i++) { for (int j = 0; j < 17; j++) { curr_prod = d[i][j] * d[i + 1][j + 1] * d[i + 2][j + 2] * d[i + 3][j + 3]; //std::cout << curr_prod << '\n'; if (curr_prod > prev_prod) { prev_prod = curr_prod; } } } return prev_prod; } int main() { std::vector<std::vector<int>> d; d = f_2_v(); /* for (int i= 0; i < 20; i++) { std::cout << i <<" : "; for (int j = 0; j < 20; j++) { std::cout << d[i][j] << " "; } std::cout << '\n'; }*/ std::cout << right(d) << " "; std::cout << upw(d) << '\n'; std::cout << diag(d); }
you really hate pastebin?
Anonymous
What is pastebin?
Artöm
What is pastebin?
Website to share code snippets
Anonymous
Anonymous
Website to share code snippets
I wasnt aware of such website
Artöm
Now you know
Anonymous
Yeah
Anonymous
https://projecteuler.net/problem=11
Abhishek Barai_Civil
If I ask my c language doubt here can it be solved ?
Artöm
Maybe
Abhishek Barai_Civil
K
Abhishek Barai_Civil
So basically here people teach c or it's just to discuss various problems on it?
Dima
this group is for advanced people
Abhishek Barai_Civil
👍
Abhishek Barai_Civil
I have just started c and in search for someone who can help me out with my doubts
Abhishek Barai_Civil
What should I do?
Anonymous
Artöm
Read a book
Abhishek Barai_Civil
Thanks 😊
Anonymous
Yes
Anonymous
Just tell me... I have looked at the code like over over again
Anonymous
#advanced https://medium.com/@mujjingun_23509/full-proof-that-c-grammar-is-undecidable-34e22dd8b664
Anonymous
Thanks
Francisco
#advanced https://medium.com/@mujjingun_23509/full-proof-that-c-grammar-is-undecidable-34e22dd8b664
I think it is a quite convoluted proof to just say that C++ template machinery is turing complete
Francisco
Oh you're right, I misread the title hahaha
Francisco
But I think I read a discussion about it in Reddit, let me check
Francisco
https://www.reddit.com/r/cpp/comments/g9nvmj/full_proof_that_c_grammar_is_undecidable/?utm_medium=android_app&utm_source=share