Danya🔥
From the page
Thilség
Dude, read the example of config file for multiple languages
I'm not asking how to configure styles for language. I'm asking how to specify what language mode the clang-format should be in. clang-format guess language by extension. I want to override that with flag, if exist. I've read the —help flag but couldn't tell which one.
Danya🔥
Yet it's in the docs lol
Thilség
Have you tried --assume-filename?
I have, but I'm unsure if it's working even with --verbose. You can specify anything to it and there is no error.
Thilség
It's hard to tell if it's working or not. As you can pass any argument to it.
Jose
I have, but I'm unsure if it's working even with --verbose. You can specify anything to it and there is no error.
try it in a controlled environment, for example, with an empty folder with 2-3 different files extension and check if it works or not (diff files are a great tool for that)
Anonymous
It's hard to tell if it's working or not. As you can pass any argument to it.
It will work if you pass the right language to it. Check out some possible fixes that clang format makes and put them in your file deliberately and see if assume-filenane fixes it
Thilség
Thank you guys.
Roman
Hello everyone!
Chat Boss
Emanuele Caruso sent a huge message, it has been re-uploaded as a file /CASO 1: Lista vuota // il nuovo nodo fara' sia da header che da tailer if (L->n_staz ==..
Emanuele
can someone help me with my code
Emanuele
i want to create a function to insert in order in a list
Alexander
Chat Boss
Emanuele Caruso sent a code, it has been re-uploaded as a file
'''''''
How to store jwt token in C? One way would be to just store them in char array, any other way?
Anupam2.7
In c++ I am getting an error that error: 'class std::vector<int>' has no member named 'push_front'; did you mean 'push_back'? v.push_front(prices[i]); ^~~~~~~~~~ there is a function for push_front and pop_front just like push_back and pop_back() right?
Danya🔥
And no pop_front also
Anupam2.7
There is no push_front function
okay, thanks for confirming
Danya🔥
okay, thanks for confirming
Just use cppreference
Anonymous
https://abstractexpr.com/2023/06/29/structures-in-c-from-basics-to-memory-alignment/ A complete tutorial on structures in C from basics to memory alignment
Danya🔥
Mahima
hi, can someone please suggest me the best course for learning C++
Mahima
I'm a beginner
Danya🔥
Read the pinned message there
Chat Boss
Abhishek Raj sent a huge message, it has been re-uploaded as a file vector<int> find(int arr[), int n, int x ) 77 { // code here 10 11 12 13 14 15 16 17 18 19 20 21..
Abhishek
Given a sorted array arr containing n elements with possibly duplicate elements, the task is to find indexes of first and last occurrences of an element x in the given array. Example 1: Input: n=9, x=5 arr[] = ( 1, 3, 5, 5, 5, 5, 67, 123, 125 } Output: 2 5 Explanation: First occurrence of 5 is at index 2 and last occurrence of 5 is at index 5.
Abhishek
Can someone help me to debug my code
Abhishek
I’m trying to solve this by using binary search(upper bound,lower bound)
abel
hi guys, how do you use the gtest in a cmake project?
abel
use the fetchcontent or create a 3rd folder?
Anonymous
I’m trying to solve this by using binary search(upper bound,lower bound)
Just use equal_bound in the algorithm header and solve the question. Your code is not even in a compilable state. So people can't help you with addressing the problems in your solution
Anonymous
use the fetchcontent or create a 3rd folder?
FetchContent is acceptable if you have gtest as the only dependency or if you don't have many dependencies. If you have a lot of dependencies using a package manager is a better solution. Using a git submodule for gtest is not an accepted solution for large projects. For small hands-on projexts that you work on independently, it is ok. But when working with many collaborators, FetchContent or a package manager like Vcpkg or Conan is a better solution the latter being more preferable
abel
Do you have some recommendations?
Danya🔥
FetchContent is acceptable if you have gtest as the only dependency or if you don't have many dependencies. If you have a lot of dependencies using a package manager is a better solution. Using a git submodule for gtest is not an accepted solution for large projects. For small hands-on projexts that you work on independently, it is ok. But when working with many collaborators, FetchContent or a package manager like Vcpkg or Conan is a better solution the latter being more preferable
FetchContent, in my opinion, is not a good solution for a serious project The reason is that it adds implicit build dependency on the internet connection, while with Git's submodules you can download the dependencies only once. Also, it is important for some companies or teams that are obsessed with security and have limited access to internet on some machines
Anonymous
> Using a git submodule for gtest is not an accepted solution for large projects. Why not?
Because when you use git submodules, you run into issues like cloning without recursive flag, rebasing can be a pain, git diff shows unrelated changes which forces you to commit unnecessary things, switching branches with submodules is a pain et al. If you are a individual developer, you can follow strict rules like dOing git submodule update and so on but when you are working with many collaborators enforcing this is a pain and most open source projects thus enforce no sub modules as a rule to prevent such things. I am not saying they are bad. They have a valid use case but calls for more discipline and the disadvantages far outweigh the advantages and hence I tend to favor package managers
Anonymous
Do you have some recommendations?
Search for Conan or Vcpkg documentation online or check out some reputed YouTube tutorial
abel
thank you so much
abel
i have been pain for this question for several days, thank you for your help
Ludovic 'Archivist'
https://en.cppreference.com/w/cpp/algorithm/equal_range
Ludovic 'Archivist'
I recommend that you explore the https://en.cppreference.com/w/cpp/algorithm page and learn and try to remember the algorithms (or just go to the page when you wanna do something)
Ludovic 'Archivist'
Related talk https://www.youtube.com/watch?v=W2tWOdzgXHA
Anonymous
Go through all the rules and the links mentioned in this post. Contravening the rules laid out here will result in a warning (least likely) or a ban (most likely). This group is meant only for C/C++ discussion. For chitchat of any other kind, go to the Offtopic chat, where anything unrelated to C/C++ programming can be discussed subject to the rules laid out for that group. For information on learning C/C++, see our list of resources at @Resources RULES: 1. Only English language is allowed. If you don't speak English, then this group is not for you. Please look elsewhere. 2. This group is meant to be used for C/C++ discussions alone. Assembly language discussions are allowed as well. The moderators' intention is to keep this group clean and to stick to the purpose the group was created for. Hence, questions or discussions about anything else is strictly forbidden. This further means that: • You should not send useless messages like "Hi"/"Hello", "I'm new here" and similar. • You should not send useless messages like "Does anyone know XYZ?", "Has anyone used XYZ?". Just ask your question directly. • You should not ask questions without checking your problem in Google or any other search engine. Doing so will result in a warning. Following this, check the Resources section of this group to see if your question has an answer there. • You should not ask exams/homework/interviews solutions. This will get you banned. Asking for something that is there in the pinned message right after joining will get you banned. 3. NSFW content (porn, nudity etc) is not allowed. 4. Religion, politics and ideological topics are forbidden. 5. A little bit of programming related jokes and memes are allowed subject to admin group's discretion. 6. Advertisements of any kind are forbidden. Job postings will not be allowed either. If you are unsure about whether something could be construed as an advertisement, please check with one of the admins before posting the message. Not doing so will result in a ban. 7. Code sharing is encouraged subject to the following rules: • Try to use markdown formatting. • For many lines (10+) of code, use a pasting service like Gist, Pastebin, Ubuntu Paste, Hastebin. Don't post walls of code in the chat window. Firstly, it inconveniences others and secondly, you are unlikely to get a response and may even get warned or banned. • Don't attach photos or videos of your screen. Screenshot captures are ok. 8. No illegal activity. This also means no piracy, no requesting/offering hacking/no posting of compiled executables. This will result in an immediate ban. 9. Respect people's privacy. Don't send private messages to people in this group without taking their permission to do so. Not following this rule will result in an immediate ban. 10. Avoid usernames that affects chat readability. The group bot Rose offers a lot of readymade responses that can be used when replying to someone. The most commonly used ones are: • #paste - Display a list of sites where code can be shared. • #markdown - Learn how to use markdown formatting. • #res - Post the link to the C/C++ resource collection. • #meta - Tell someone to get to the point! • #howtoask - Tell someone how they should ask a question. • #ot - Tell someone that their question is off-topic and hence must be moved to the OT group.
You guys have so many rules ain't fun
Dima
and
Dima
this is the society, unless that group wasn’t spammed that much with stupid questions and photos of a screen lol you can go to #ot cxx group and memes are usually in here
Anonymous
Related talk https://www.youtube.com/watch?v=W2tWOdzgXHA
I loved this one: https://youtu.be/2olsGf6JIkU Has to be updated for ranges but.
Anonymous
https://en.cppreference.com/w/cpp/algorithm/equal_range
Didn't realize that they had changed the name.
Anonymous
You guys have so many rules ain't fun
Why do you want to have fun on Telegram and that too in a programming community? Don't have friends in real life?
Danya🔥
I loved this one: https://youtu.be/2olsGf6JIkU Has to be updated for ranges but.
https://youtube.com/@code_report I love his videos and talks on algorithms
Anonymous
https://youtube.com/@code_report I love his videos and talks on algorithms
His series on Category Theory is good too if you have some previous experience.
Anonymous
Guys see in c++ we have std:: min function right so it's a standalone function na means its not written in any class right?
Anonymous
Anonymous
Guys see in c++ we have std:: min function right so it's a standalone function na means its not written in any class right?
Use the documentation for questions like these. Cppreference is the recommended documentation site for C++
Osama
guys i wanna learn C++, give me best method ?
Dima
there’s no the best method and it will take ten years
Osama
no, i wanna learn C++ for basic and next learn data structure
Osama
not for work
Osama
only for basics
abel
i meet a question
abel
when i use the clangd to complie a code which use the gtest from vcpkg,it doesn't work
abel
but when i change it to MSVC, i success
abel
is that means these two program use different method to find head files?
Danya🔥
when i use the clangd to complie a code which use the gtest from vcpkg,it doesn't work
Clangd is not a compiler, so you can't compile code with it
abel
sorry,is clang
Danya🔥
Do you use Visual Studio?
abel
i use visual studio code
Danya🔥
What build system do you use?
abel
cmake
Anonymous
when i use the clangd to complie a code which use the gtest from vcpkg,it doesn't work
"It doesn't work" could mean a whole lot of things.