Ka. LOVE |• kalhim ng ilaw • TSV: Lokal ng SUCAT
Ka. LOVE |• kalhim ng ilaw • TSV: Lokal ng SUCAT
Anshul
Where can i watch it?🥺
YouTube go for any video on 2d matrix. It's very basic
Anshul
Then try to solve some problems on 2d arrays and you'll be good with it
Ka. LOVE |• kalhim ng ilaw • TSV: Lokal ng SUCAT
I know how to run some array but the problem that given to us is very difficult 🤧🤧🤧
Anshul
Or if you have any specific doubt, ask here. Many people are really good here to help you with any problem related to c/c++
Anshul
I know how to run some array but the problem that given to us is very difficult 🤧🤧🤧
Then share the problem and tell where did you stuck Someone will help you
Ka. LOVE |• kalhim ng ilaw • TSV: Lokal ng SUCAT
Waaaahhh thankyou guysss. I'll try again 💓💓
Ka. LOVE |• kalhim ng ilaw • TSV: Lokal ng SUCAT
I'll try to run thankyouuuu guys🥺🥺💚
Anshul
👍
Anonymous
include<iostream> using namespace std; int main() {     int decimaleNum, binarioNum[20], i=0;     cout<<"Insersci numero decimale: ";     cin>>decimaleNum;     while(decimaleNum!=0)     {         binarioNum[i] = decimaleNum%2;         i++;         decimaleNum = decimaleNum/2;     }     cout<<"\nconversione numero binario: ";     for(i=(i-1); i>=0; i--)         cout<<binarioNum[i];     cout<<endl;     return 0
Anonymous
Someone can explain me the for cicle?
ɛ n h ᴀ n c ɛ ґ 🧟‍♂️
Muyi
oh, great then
KAZEEM
His question was to use while loop
Okay...buh which is better...for loop or while loop for his case scenario
Benedetto Califfo
Hi guys. Suppose I instantiate a variable like this: size_t len; Now, what is len? I mean, If I do int a = 10 I know that at the memory address &a there is 10. What about len?
Pavel
Hi guys. Suppose I instantiate a variable like this: size_t len; Now, what is len? I mean, If I do int a = 10 I know that at the memory address &a there is 10. What about len?
It's uninitialized, meaning the value will be whatever garbage there was in that memory. https://stackoverflow.com/questions/30172416/uninitialized-variable-behaviour-in-c
Pavel
Uh ok ty
Usually you always need to initialize your variables, however in some very specific cases it can be kind of optimization not to do so if you sure it will be initialized in all the branches before it's used. In practice it's very rare when you need to avoid initialization, because the compiler usually able to skip the extra initialization if it sees that all the branches overwrite the value anyway before reading it, but avoiding initialization can result in errors when code being changed. So better to always initialize variables :)
Benedetto Califfo
Yea yea, it's not my code, it's a tricky test I have to pass
Nameful
Can I get the type of the current class somehow in C++, something like reflection?
Nameful
I want something like PHP's static type.
DEV 7
#include<iostream> using namespace std; int area(int a){ return a*a; } float area(float l , float b ){ return l*b; } int area(int b ,int h ){ return b*h; } int main(){ cout<< area(4); cout<<area(2.4,4.5); cout<<area(3,4); return 0; } why I am getting error ??
Lancern️
#include<iostream> using namespace std; int area(int a){ return a*a; } float area(float l , float b ){ return l*b; } int area(int b ,int h ){ return b*h; } int main(){ cout<< area(4); cout<<area(2.4,4.5); cout<<area(3,4); return 0; } why I am getting error ??
The function call expression area(2.4, 4.5) is ambiguous. The type of 2.4 and 4.5 is double, and no area function overloads take two double as parameters. Thus, compiler tries to perform overload resolution and it finds two suitable overloads, namely area(int, int) and area(float, float). The compiler cannot decide which one to choose, so the error.
Anonymous
Anyone guide plz what is OOPS?
Typing...
Anyone guide plz what is OOPS?
Object oriented programming
Pavel
Anyone guide plz what is OOPS?
I guess you mean OOP? https://en.wikipedia.org/wiki/Object-oriented_programming
Anonymous
Hi guys. Suppose I instantiate a variable like this: size_t len; Now, what is len? I mean, If I do int a = 10 I know that at the memory address &a there is 10. What about len?
It depends on where len is defined. If it is defined outside of any function i.e. in namespace scope or global scope then it is initialized to 0. If it is defined within a function then it is uninitialized and any use of that variable other than an assignment or taking its address will result in Undefined Behavior.
Anonymous
Can I get the type of the current class somehow in C++, something like reflection?
If it is a class that is in an inheritance hierarchy with virtual functions or the class itself has atleast one virtual function, you can use RTTI but the value representing the class name is implementation defined and you won't see the exact name you used.
Morsal
Using c++: You are given a huge positive integer A. It is guaranteed that this number has no leading ZEROS. You can perform two types of operations using some given key value K (a positive integer): 1. You can add any multiple of K to A. (A = (A + K ∗ X), whereX = 0, 1, 2, 3, 4, 5. . . . . .) 2. You can subtract any multiple of K from A. (A = (A − K ∗ X), whereX = 0, 1, 2, 3, 4, 5. . . . . .) Your friend believes that the pair (A, K) is beautiful if you can make A become ZERO through performing the previous operations only. Find out if a given Pair (A, K) is beautiful pair or not.
Morsal
What did you try?
It is a task and i don't know what i have to do .
Morsal
How big is A?
In real as said it have to be in thousands
Morsal
Input The first line contains a single integer T denoting the number of test cases. The first input line of each test case contains a huge Integer A (1 ≤ |A| ≤ 105 ) where |A| is the length of the integer A. The second line contains an integer K (1 ≤ K ≤ 109 ) denoting the key value. Output For each test case, print "YES"(without the quotes) if the pair (A, K) is beautiful. Otherwise, print "NO".
Anonymous
In real as said it have to be in thousands
You mean less that 99999? The reason why I am asking this is because I have to know if A can be stored in an unsigned long long or does it have to be stored in a string
.
How big is A?
long long int?
Anonymous
long long int?
No. A has 105 digits. So it can't be stored in an unsigned long long. It has to be a string
Morsal
3 YES 12 YES 3 NO 12 4 12 5
Anonymous
Nils
Should std::string_view be passed by copy or by reference?
Anonymous
Should std::string_view be passed by copy or by reference?
string_view is the equivalent of a fat pointer (slice) in Rust. It has a pointer to the first character in the view and the length of the range. So it is efficient to pass it by value. There are only a very few cases where you need to use a reference with string_view and there aren't many of those that you see often in daily use.
Anonymous
But the tow operations are different
Think about it. You add K*X and you subtract K*Y. Can't you combine both into a -K(Y-X) or K*(X-Y) depending on whether X is bigger or Y is bigger
KAZEEM
There's less talk about C in this group...and am a strong advocate of C....buh it seems C++ has taken all glory
Anonymous
There's less talk about C in this group...and am a strong advocate of C....buh it seems C++ has taken all glory
No one is preventing you from discussing C. Quite a few of us use both the languages
Anonymous
Do you think one can combine the two languages?
I never said combine. And yes you can do it. If you are a strong advocate of C, then you must know enough C to know it is possible.
Sebas Tian
Guys, i have a simple question: char *string=(char *)malloc(10); string=(char *)realloc(string,11); if(string==NULL) ... If the realloc() fails and return NULL, the string allocated before by malloc() will be free?
Anonymous
https://github.com/ron4fun/IntXLib4CPP
He can use GMP as well. The reason why I suggested using a string is because it looked like he was doing competitive programming. You can't use arbitrary libraries while doing Competitive Programming.
Mustapha
Please i need some C programming code
its
Gm
Anonymous
int n; cout <<"Enter number of Rows:"; cin >> n; for(int i=1; i<=n;i++){ for(int j=1; j<=i; j++{ cout<< i; } cout<< endl; }
Hitesh
Hello All, I am trying to access shared file from another computer system on same network. i wrote c++ code for testing it worked completely fine but when i tried to run same code in my software I am getting file size as (-1) and error is permission denied What is reason for it and how to fix this?
Odette
Thanks
Odette
Please what's app can I install for beginners in C++
Odette
Odette
Thanks
Anonymous
Thanks
M
Hi guys
M
I want some help in c language
M
How can i read from a file has information about students line b line and store the name in array and the gpa in another array and the level and stuff
Anonymous
I want some help in c language
What's your requirement ??