𝕷𝖔𝖗𝖊𝖓𝖟𝖔
Hi guys, so in C there's this function called "isalnum" to verify wether an element is alphabetical or numerical or not. But I'm in need for a function that only tells me if the element is numerical, do you know such a function?
𝕷𝖔𝖗𝖊𝖓𝖟𝖔
thx, I was trying with isnum ahahah
Ludovic 'Archivist'
thx, I was trying with isnum ahahah
It is always isXXXXX, ie the description is 5 characters so digit, space, alpha, alnum...
Ludovic 'Archivist'
It is very dumb tbf, but C is old and people named things stupidly back in the days
𝕷𝖔𝖗𝖊𝖓𝖟𝖔
Thanks!
Ольга
Nana
By the way, your implementation is just fine, why you need class?
I want to use it as an alternative way to catch error(s) in my program
Nana
Ok
Nana
which language are u willing to learn c or c++
Nana
send me a personal message
Nana
Can u help me to do it?
𝕷𝖔𝖗𝖊𝖓𝖟𝖔
Hi guys, is it possible to take an input from the user, but make it Macro? For istance, I have this macro: #define MAP_SIZE 10 But, honestly, I would like my user to be able to choose the size of the map, and, at the same time, I would like it to be macro, so I can access it whenever I need it. My professor never explained something quite like this, so perhaps it may be a stupid question
Ольга
Hi there. I'm trying to combine 1d array and 2d array into one and I can't find anywhere at least an example of code everywhere is combining two 1d arrays, I tried to do by analogy but I did not succeed, it just does not copy the required numbers and takes some obscure garbage. I have already dealt with this problem, but I can not solve it and my term is coming to an end. I will be very grateful for the explanation. And I can provide the code if needed. Thank you for listening
Pavel
Row
How do you store the original 2D array? Is it C or C++?
Ольга
How do you store the original 2D array? Is it C or C++?
You mean the initial array? If so it looks like int matrix [rows] [cols] and the one in which I want to copy the dimensions [rows + 1] [cols]
Anonymous
Yes
so many ways to do it. like u can create to for loops with one inside the other😏 anywho u can iterate with one of the for loops handling the first 1d array the other handling the other
Anonymous
if u know what I mean
Anonymous
or should I explain further
Anonymous
also could the admins of this group turn off the slow mode coz its annoying
Ольга
so many ways to do it. like u can create to for loops with one inside the other😏 anywho u can iterate with one of the for loops handling the first 1d array the other handling the other
I don't have a very good level of English, maybe I'll show you the code and you tell me if I'm at least close to a solution?
Ольга
sure. send the code
https://onlinegdb.com/PIkyRnKbk
Majd
Sorry guys, it was a mistake.
LeBouy
a C program to read two matrices of whole numbers and add the two matrices. Prompt the user for the matrix size and check that it is in range 2≤ range ≤ 5.
Anonymous
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Control Panel\Mouse] "SmoothMouseXCurve"=hex:\ 00,00,00,00,00,00,00,00,\ 70,3D,0A,00,00,00,00,00,\ E0,7A,14,00,00,00,00,00,\ 50,B8,1E,00,00,00,00,00,\ C0,F5,28,00,00,00,00,00 "SmoothMouseYCurve"=hex:\ 00,00,00,00,00,00,00,00,\ 00,00,38,00,00,00,00,00,\ 00,00,70,00,00,00,00,00,\ 00,00,A8,00,00,00,00,00,\ 00,00,E0,00,00,00,00,00 [HKEY_CURRENT_USER\Control Panel\Mouse] "MouseSpeed"=hex:2 "MouseThreshold1"=hex:2 "MouseThreshold2"=hex:12 "MouseSensitivity"="10" "ActiveWindowTracking"=dword:00000000 "DoubleClickSpeed"="200" "DoubleClickHeight"="4" "DoubleClickWidth"="4" "MouseHoverTime"="100" "MouseHoverHeight"="4" "MouseHoverWidth"="4" "MouseTrails"="0" "SnapToDefaultButton"="0" "SwapMouseButtons"="0" "ExtendedSounds"="No" "Beep"="No"
‌Andriel
english pls
Flofy
Que tanto debo saber de c++ para poder hacer cosas avanzadas, como sistemas operativos, softwares profesionales, motores de juegos, lenguajes de programación, navegadores etc..
Flofy
Que tanto debo saber de c++ para poder hacer cosas avanzadas, como sistemas operativos, softwares profesionales, motores de juegos, lenguajes de programación, navegadores etc..
How much do I need to know about c++ to be able to do advanced things, such as operating systems, professional software, game engines, programming languages, browsers, etc.
Anonymous
Ludovic 'Archivist'
How much do I need to know about c++ to be able to do advanced things, such as operating systems, professional software, game engines, programming languages, browsers, etc.
It depends a lot on the code quality that you want, how rigorous you are, how much performance you need... C++ is closer to be 5 languages under a trenchcoat than being a single language, it has lots of features some of which I would say even I who is teaching it and have been using it for 10 years do not know enough about
Ludovic 'Archivist'
And that is just the language, not the ecosystems, compiler details, design patterns, conventions, tooling, and the whole rest of the iceberg that is still immersed
Ludovic 'Archivist'
How much do I need to know about c++ to be able to do advanced things, such as operating systems, professional software, game engines, programming languages, browsers, etc.
If you want to use C++ professionally and alone, you need a good amount of confidence in your knowledge of computer science as well as the language itself. If there is a senior engineer supervising you that knows the language very well and stays up to date on it, you need to know surprisingly little about it to be useful
Flofy
@QNeko Would you recommend me to learn c++ in 2022?
Flofy
do you think it will be sued during the 20s'
Ludovic 'Archivist'
@QNeko Would you recommend me to learn c++ in 2022?
Absolutely, even more so now that the language is evolving and getting a makeover every 3 years
Ludovic 'Archivist'
C++ doesn't beg the question of 'what can you do with it' but 'what can't we do with it'
paper
How much do I need to know about c++ to be able to do advanced things, such as operating systems, professional software, game engines, programming languages, browsers, etc.
Learn the basics of programming itself , from here it's just do and try. By the things you mentioned i will recommend you to learn and practice algorithms too + some math concepts and theories (but it really depends on what do you develop)
paper
@QNeko Would you recommend me to learn c++ in 2022?
If you're looking for a job , there are better languages for that
Flofy
If you're looking for a job , there are better languages for that
No, I only want to use it to do personal but complex projects.
Flofy
I think c++ is a great language, but I think it's going to die soon, it doesn't have a great support like javascript or python. It is a language that is used less and less, people begin to migrate to other languages.
SUBID
#include <iostream> #include <cstdlib> #include <cstdio> #include <cstring> #include <iomanip> using namespace std; // functions to generate bills void generateBillHeader(char name[50], char date[50]) { cout << "\n\n" << endl; cout << "\t My Company" << endl; cout << "\t ============" << endl; cout << "Date:" << date << endl; cout << "Invoice To:" << name << endl; cout << "==========================================" << endl; cout << "Items\t\t" << "Qty\t\t" << "Total\t\t" << endl; cout << "==========================================\n" << endl; } void generateBillBody(char item[25], int qty, float price) { cout << item << "\t\t"; cout << qty << "\t\t"; cout << fixed << setprecision(2) << qty * price << "\t\t" << endl; } void generateBillFooter(float total) { float dis = 0.01 * total; float netTotal = total - dis; float cgst = 0.09 * netTotal, grandTotal = netTotal + 2 * cgst; cout << "==========================================\n" << endl; cout << "Sub Total\t\t\t" << fixed << setprecision(2) << total << endl; cout << "Discount @1%\t\t\t" << fixed << setprecision(2) << dis << endl; cout << "\t\t\t\t==========" << endl; cout << "Net Total\t\t\t" << fixed << setprecision(2) << netTotal << endl; cout << "CGST @9%\t\t\t" << fixed << setprecision(2) << cgst << endl; cout << "SGST @9%\t\t\t" << fixed << setprecision(2) << cgst << endl; cout << "==========================================\n"; cout << "Grand Total\t\t\t" << fixed << setprecision(2) << grandTotal << endl; cout << "==========================================\n"; } struct items { char item[25]; float price; int qty; }; struct orders { char customer[50]; char date[50]; int numOfItems; struct items itm[50]; };
SUBID
no there was no external link
SUBID
it was just a cpp code
SUBID
🤦‍♂️
SUBID
anyone please help to send rest of the code
SUBID
🙂🙂
Dima
use pastebin
SUBID
use pastebin
whats that
SUBID
??
paper
I think c++ is a great language, but I think it's going to die soon, it doesn't have a great support like javascript or python. It is a language that is used less and less, people begin to migrate to other languages.
Many system are written and working on c++ so it will not lose popularity very soon , but c++ is in a competition with rust , and rust overcomes it by far in the aspects of popularity and the community But nonetheless c++ is very unique from all of the other low level languages and it's here to stay , just like COBOL that should've been dead a long time ago but still used because all of the software that's running on it
Ludovic 'Archivist'
And also toxic as shit, I do not do Rust because it feels like belonging to a cult where you cannot criticize shitty code
Leovan
Why compilation simple Hello World file on Windows 10 can take 9 seconds, for example Fedora 35 (LIVE!) on this machine take 0.8 seconds. CPU and RAM load is okay when compile on Windows.
Leovan
nono
Leovan
clear Windows 10 and Fedora Live from flash drive
Ludovic 'Archivist'
clear Windows 10 and Fedora Live from flash drive
What compiler suite are you using on windows?
Ludovic 'Archivist'
gcc/msys, gcc/wsl or gcc/cygwin ?
Ludovic 'Archivist'
cygwin
https://github.com/microsoft/Windows-Dev-Performance/issues/15
Ludovic 'Archivist'
TL;DR, Cygwin has a lot of overhead for IO, comparably with WSL1 and msys, as it has to emulate a unix API from the windows API
Pavel
Is such implementation of serializing int safe? (if we skip endianness issues) template<typename Int> void WriteInt(std::vector<std::byte>& inOutByteStream, Int integer) static_assert(sizeof(std::array<std::byte, sizeof(Int)>) == sizeof(Int)); auto& byteRepresentation = std::bit_cast<std::array<std::byte, sizeof(Int)>&>(integer); inOutByteStream.insert( inOutByteStream.end(), std::begin(byteRepresentation), std::end(byteRepresentation) ); } I'm a bit concerned about casting to std::array, which is struct with one member which is C-style array, it feels safe in the current implementation, but I'm not sure if I can rely on this implementation detail.