Anonymous
hi
THE ONE
Sir im a beginner i would like to learn C/C++ where should i start from
THE ONE
Thank you sir i would like to lett than im a student just began to choose computer science i would like to get coaching in coding is there any possible way that i can get training online
Anonymous
Try code with Harry or Jenny lectures
r
ok skid
John
cherno is amazing channel
Ольга
Hello averyone ! I still can't figure out how to check the elements in the structure field for the number of numbers in which the digits are different. I insisted on doing it from 86 to 105 lines of code but something is definitely wrong . As far as I understand it checks correctly but displays only the check of two numbers ie 8134 and 8322 the first two digits in these numbers are different but the other two in the first are different in the second are the same. And only the first should be tested. I will be grateful for any help. Thank you in advance https://onlinegdb.com/htTPQMhPj
trimbleyy
HELP ME WITH THIS CODE PLEASE IY WORKS BUT DOESN'T GIVE OUTPUT #include<stdio.h> #include<string.h> int main() { char category[20]; printf ("enter your category\n"); scanf("%s",&category); if (category=="needy") { printf("get 1000"); } }
trimbleyy
if you're importing string.h why not using strcmp ?
I TRIED AT FIRST BUT IT DIDN'T WORK #include<stdio.h> #include<string.h> int main() { char category[20]; printf ("enter your category\n"); scanf("%s",&category); if (category=="needy") { printf("get 1000"); } else if(category=="blind") { printf("get 2,000"); } else if(category=="disabled") { printf("get 3,000"); } return 0; }
\Device\NUL
And because its array of char, you only compared the pointer, not the entire array. you can only do that with std::string that support comparing string with == operator
\Device\NUL
c have namespaces ? 🤔
no, I talk about std::string that available on C++
John
c have namespaces ? 🤔
Not that I'm Aware of any
Teatro
Hello, is there a method to do many comparison without putting a lot of ||? Like this: char ascci; if (ascci == 'a', 'b', 'c') { ... }
Anonymous
Hello, is there a method to do many comparison without putting a lot of ||? Like this: char ascci; if (ascci == 'a', 'b', 'c') { ... }
Unfortunately, no. But it’ll be shipped with C++23 which will be released after our death. It’s 2022 and compilers still not supporting C++20 modules
Teatro
Oh :(
pavel
Msvc supported
Anonymous
Msvc supported
Now I’m a microsoft fan (C++ is originally *standardized at Microsoft)
pavel
Now I’m a microsoft fan (C++ is originally *standardized at Microsoft)
But it's not enough while cmake doesn't support it
pavel
No common interface between them
Anonymous
is it? 🤔
Actually, Microsoft standardized it.
Anonymous
That’s C#
Remember Win3x? I don’t remember too, however Bill Gates at Win Dev conference announced a standard version of C++ that developers could use to develop their apps with no pain
pavel
https://docs.microsoft.com/ru-ru/cpp/cpp/modules-cpp?view=msvc-170
Nomid Íkorni-Sciurus
wasn't there a Watcom standard too?
Anonymous
pavel
Much effort in this way but not enough yet. No library repository yet 😭
Nomid Íkorni-Sciurus
I mean their compiler
I meant compiler too
Anonymous
I meant compiler too
So it’s not their job?!
Nomid Íkorni-Sciurus
So it’s not their job?!
uh? what do you mean?
Nomid Íkorni-Sciurus
No common interface between them
yeah this is sad I had to write Findxxx to make the tools work for my project eventually I discovered Conan.
Nomid Íkorni-Sciurus
Watcom was (and sadly still is) a multiplatform compiler suite
Nomid Íkorni-Sciurus
(I say sadly because the OpenWatcom suite is ancient, though it's still available)
Anonymous
Watcom was (and sadly still is) a multiplatform compiler suite
I mean Visual C++, it gave developers a new perspective
Nomid Íkorni-Sciurus
Conan disappointed me
for what use case? :o
Anonymous
Conan disappointed me
It disappoints everyone
Nomid Íkorni-Sciurus
Nomid Íkorni-Sciurus
I found Conan quite simple to setup and to work with
Nomid Íkorni-Sciurus
I didn't try vcpkg though
Anonymous
I hate CMake and Conan but we’re forced to use them ☹️
Nomid Íkorni-Sciurus
I mean Visual C++, it gave developers a new perspective
ah, yeah, sure it did; most of the tools thereafter would be modeled after the VS suite
pavel
for what use case? :o
Can't compile lib for my platform. Has some collision with other lib. Hard to switch between debug release (yiu have to invoke cmake generator to switch)
Nomid Íkorni-Sciurus
Anonymous
Sorry admins for many msgs, but these may be useful for other people.
pavel
I didn't try vcpkg though
Vcpkg is the best what we have now. But i don't think it has future in nowadays state. Some solutions here is very bad
Nomid Íkorni-Sciurus
Maybe someone know?
I'm guessing because of trimming? if you have constant values it depends on your machine but could be approximated to a certain amount
Nomid Íkorni-Sciurus
I wouldn't do so for float64/long double stuff
Leovan
I'm guessing because of trimming? if you have constant values it depends on your machine but could be approximated to a certain amount
Hm, interesting guess. My mentor said better to construct float instead of cast when i return value from pow. (Better ofc to use powf, but if choose before cast and construct). And i cant ask him the reason for now
SerFed
Hello! Please help me. I'm tried to make next construction: class A { B b; }; class B { A a; }; but VS show errors. what wrong?
Ольга
Hi to all! Please help the compiler in giving the error, and I can't figure out what caused it. I will be grateful for your help. I beg you because I really can't notice her anymore. thanks in advance https://onlinegdb.com/kizSCJTMJ
\Device\NUL
Now I’m a microsoft fan (C++ is originally *standardized at Microsoft)
Really ? Doesn't C++ Commitee is independent ?
pavel
Really ? Doesn't C++ Commitee is independent ?
He meant it can't be interpreted as variable name
Ludovic 'Archivist'
Unfortunately, no. But it’ll be shipped with C++23 which will be released after our death. It’s 2022 and compilers still not supporting C++20 modules
It is a bit more complicated, compilers support modules but you need a build environment to use them. Most of the wait is waiting for CMake to implement modules
Ludovic 'Archivist'
Remember Win3x? I don’t remember too, however Bill Gates at Win Dev conference announced a standard version of C++ that developers could use to develop their apps with no pain
That was their own flavour of it and was already incompatible with c++98. C++ Iso standardization was easier for IBM than it was for Microsoft
Ludovic 'Archivist'
btw. Its not ascci but it is ASCII. But that only variable, so dont worry about it. Hahaha
Well, in C charset is implementation defined, in C++ it is "valid UTF-8 if all codepoints are below or equal to 127" which is mostly valid ASCII
Damo
Gud morning
Damo
Is there any good course after completing b.com (ism) in IT field
Damo
Is there any good course after completing b.com (ism) in IT field
If it is there.. please tell me the institute with good placement.
Anonymous
#include <stdio.h> int main() { int=i,space,rows,k=0,count=0,count1=0; printf("Enter the number of rows: "); scanf("%d",&rows); for(i=1;i<=rows;++i) { for(space=1;space<=rows-i;++space) { printf(" "); ++count; } while(k!=2*i-1) { if (count<=rows-1) { printf("%d ",(i+k)); ++count; } else { ++count1; printf("%d ", (i+k-2*count1)); } ++k; } count1=count=k=0; printf("n"); } return 0; } any one can understand me this pattern from c programming
Anonymous
I already complie this program But i didn't understand the running of while loop
Iwan
Well, in C charset is implementation defined, in C++ it is "valid UTF-8 if all codepoints are below or equal to 127" which is mostly valid ASCII
I am only talk about "ascci". I can not found ascci in google, but i can find ascii. Not double c but double i.
Hussein
use a lookup table then you will compare only once
it is really useful especially when you have many characters it goes like this: int lookup[256]; memset( lookup , 0x00 , 256 * sizeof(int) ); lookup[ ‘a’ ] = 1; lookup[ ‘b’ ] = 1; lookup[ ‘c’ ] = 1; if( lookup[ (unsigned) ascii == 1 ) { //do something }
Hussein
Hello, is there a method to do many comparison without putting a lot of ||? Like this: char ascci; if (ascci == 'a', 'b', 'c') { ... }
or you can use a switch statement that will compare once and jump to the right condition but look-ups in this case are better