klimi
Hello mates
Please, read the rules and respect them
Rose
Welcome 🌹💦慧慧🌹! Please read the pinned message 🙂 Click the button below to unmute yourself.
Chat Boss
ㅤitsmanjeet sent a code, it has been re-uploaded as a file
itsmanjeet
ㅤitsmanjeet sent a code, it has been re-uploaded as a file
thanks, I need help here, Parent class A B is child of A C is child of A I create a new Object of B of type A* and cast it to C, I need compiler to warn me for this
Pavel
thanks, I need help here, Parent class A B is child of A C is child of A I create a new Object of B of type A* and cast it to C, I need compiler to warn me for this
Don't do static_cast in this case, do dynamic_cast and check that the result is not a nullptr. static_cast doesn't do any runtime checks, it just changes the type of the pointer (and sometimes shifts it in case of multiple inheritance), so it is quite unsafe in general
Pavel
Static cast is mostly used when the developer is 100% sure the cast will be correct (e.g. because they checked the type by some other means)
itsmanjeet
Static cast is mostly used when the developer is 100% sure the cast will be correct (e.g. because they checked the type by some other means)
Okk, I read something wrong somewhere, they said static_cast for parent to child And dynamic_cast for child to parent
itsmanjeet
Thanks 🤝
Bumble
Hey, guys anyone attended zoho interviews previously, please share ur experience on that.. Who are all going to attend zoho interview on may 4th
Bumble
wrong group
What's the problem
klimi
What's the problem
you are spamming wrong group
Devil Within
can i ask about C# here ?
Devil Within
No
oh okay
Aaryan
Given a Integer array A[] of n elements. Your task is to complete the function PalinArray. Which will return 1 if all the elements of the Array are palindrome otherwise it will return 0
Aaryan
class Solution { public: int PalinArray(int a[], int n) { // code here // int r=0,l=0; for(int i=0;i<n;i++) { int r=0,og=a[i]; while(a[i]>0) { int l=a[i]%10; r=r*10+l; a[i]/=10; } if(r!=og) return 0; } return 1; } };
Aaryan
in this solution why test cases don't pass when i change last if loop condition to !r==og
Aaryan
Oh ok
Vicky
Oh ok
Yeah
مرتضی
This bot talks in street language now huh 😆
Reginald
I am a newbie here. I just completed my course as a c++ programmer and want a griwth platform. Things seems a bit confusing here though.
Reginald
Please i installed QT frame work. But i get 'kit not found' each time i try to create an empty project.
Reginald
I need help please!
Simple Sorcerer
Ighor
QT C++
do you mean Qt?
Simple Sorcerer
Reginald
go to Qt Creator settings and add the kit manually
Tried locating the kit manually, no success. Seems not to be there
Reginald
is there any one here who uses QTframe work?
Suka
I need help please!
open youtube search for "How to configure the Qt Creator"
Adele
Hey any phd student here
Rose
Hey any phd student here
Don't ask meta questions. In other words, don't ask to ask. Questions like "Does anyone know XYZ?", "Has anyone used XYZ?" or "Can someone help me?" are all considered meta questions because they don't specify what your actual problem is. These questions give the impression that you want people to approach you and offer their help as if they don't have any other work to do. Now doesn't that expectation make you look like an idiot? If you have a question ask it directly. You are more likely to get a response that way.
Rose
User Beautiful girl has 1/2 warnings; be careful! Reason: nohello
Rose
Another one bites the dust...! Banned Dhdjdkdk. Reason: course selling
Nicholas
In case i'll need some help in the future, is there someone good with the Windows api? This is not a meta question, this is the real question haha
Nicholas
@kawaiighost
Does he have experience with that? I've been practicing for some months but knowing that there's someone who can help me when needed would be amazing
Elena
Elena
ㅤitsmanjeet sent a code, it has been re-uploaded as a file
With static_cast, you are saying to the compiler that you know better than it and hence enter the realm of Undefined Behavior in this case
\Device\NUL
@kawaiighost
Bruh, I'm not that advanced.
Tobofoxy
All C compilers are the same, or do they have different features?
\Device\NUL
All C compilers are the same, or do they have different features?
C compilers is conforming to the same standards and ABI but the code generated maybe differs as long as following the ABI
zawkin | 🇵🇸
template <typename T, sizet N> sizet arraySize(T (&arr)[N]) { return N; } Category cats[] = {Category(), Category(), Category()}; std::cout << arraySize(cats); //__working void printTasks(Category categories[]) { int size = arraySize(categories); // NOT WORKING }
zawkin | 🇵🇸
passing an array to function turns it into pointer type ib
how can i fix it? should I receive array as reference or pointer?
Anonymous
how can i fix it? should I receive array as reference or pointer?
the argument is not a reference to an array. If you want to pass the array by reference, you should specify it explicitly: void printTasks(Category (&categories)[3]) { int size = arraySize(categories); }
Anonymous
or use stl std::array
Anonymous
its just a thin wrapper around it
Aaryan
Is here any one who has followed abdul baris udemy course on c and c++
Rose
Is here any one who has followed abdul baris udemy course on c and c++
Don't ask meta questions. In other words, don't ask to ask. Questions like "Does anyone know XYZ?", "Has anyone used XYZ?" or "Can someone help me?" are all considered meta questions because they don't specify what your actual problem is. These questions give the impression that you want people to approach you and offer their help as if they don't have any other work to do. Now doesn't that expectation make you look like an idiot? If you have a question ask it directly. You are more likely to get a response that way.
zawkin | 🇵🇸
/* strcpy: copy t to s; pointer version 2 */ void strcpy(char *s, char *t) { while ((*s++ = *t++) != '\0') ;
Ziky
Why comparing to '/0' is reduntant?
while runs until condition evaluates to non zero
Caerulea蓮
which os is better linux or windows?
Arnold
thought provoking question ^
Rose
which os is better linux or windows?
User Caerulea蓮 has 1/2 warnings; be careful! Reason: offtop
harmony5 🇺🇳 ⌤
Антон
Temple os
actually
Ludovic 'Archivist'
which os is better linux or windows?
It depends on what you are doing. I would say that, in general, for development, Linux tend to be more comfortable, with dependency management being much less of a problem than it is on windows.
Ludovic 'Archivist'
I have to admit that working in teaching and having to explain the hoops one has to go through to make any dependency work on windows may be radicalizing me slightly
Nicholas
Hi guys, i have a question. As you probably know, Visual Studio allows you to see the allocated memory of a program while debugging. After writing a simple program that allocates 2 int variables, i took a look at all the allocated memory and saw a bunch of values. I have some questions about it: 1- After scrolling up or down for some seconds through all the memory addresses, i reach a point where all the values become uninitialized (represented by a question mark). What does it mean exactly? Is it just empty memory? Or it's memory that may be used by other programs but not shown? And does all the initialized data belong to my program? 2- There are groups of memory addresses containing chars that when visualized through the memory viewer, form sentences containing words like "system" etc... Unfortunately i don't have a pc with me so i can't show them.
\Device\NUL
There's also stuff called Virtual Memory Address
Rose
User purple rose has 1/2 warnings; be careful! Reason: nohello
Nicholas
Have you learn assembly and know how many types of allocation?
I don't know assembly but if you know the answer that i need, you can explain anyway and then i'll go look up the stuff i don't know on google
Chat Boss
ㅤDisabled Account [!] sent a code, it has been re-uploaded as a file
Chat Boss
ㅤDisabled Account [!] sent a code, it has been re-uploaded as a file
ㅤDisabled Account [!] sent a code, it has been re-uploaded as a file
V
What the... ?!