Cri | ferrosxlupus
Send It if you want
Cri | ferrosxlupus
I think
Azhar
#include<iostream> using namespace std; class Test { private: int x; public: Test(int x = 0) { this->x = x; } void change(Test *t) { this = t; } void print() { cout << "x = " << x << endl; } }; int main() { Test obj(5); Test *ptr = new Test (10); obj.change(ptr); obj.print(); return 0; }
Ermin
What's problem with my code can anyone fix it ?
You can dereference this and t (*this=*t) and that will work #include<iostream> using namespace std; class Test { private: int x; public: Test(int x = 0) { this->x = x; } void change(Test* t) { *this = *t; } void print() { cout << "x = " << x << endl; } }; int main() { Test obj(5); Test* ptr = new Test(10); obj.change(ptr); obj.print(); return 0; }
Anonymous
Ggtt
Imgui
Дмитрий
Guys, can you help with a piece of code in C: in general, 3 arrays and 2 array sizes are passed to the function. Array u with elements from (1 to 10 ) and a , with elements specified by the user (the main thing is that they are included in u), as well as their sizes , size u = 10 , and the size of a is respectively set by the user . So, you need to write elements in the form of 0 and 1 to the third array, 1 will be where the index of the array u during the cycle from 1 to 10 will match the value of the element that is in A, and in the remaining positions from 1 to 10 there will be 0
Anonymous
A serial transmission line can transmit 960 characters a second. Write a program that will calculate how long it will take to send a file, given the file's size. Try it on a 400MB (419,430,400 byte) file. Use appropriate units. (A 400MB file takes days.) c++
✞✟✞✟✞
Someone help me with this pls??
char is 1 byte, therefore just divide the file size in bytes by 960
Christian
/get
Дмитрий
/get
E
can anyone help with this pls Write a small program (can be just a main program without any functions) that reads the standard input and copies what it reads to the output so that is it a valid C string constant. In other words if it reads in the string EECS 2031 Linux and C it produces: "EECS2031\n\ Linux and C" In other words it replaces new lines with \n\ followed by a new line. It also replaces double quotes with backslash followed by double quotes. So, if it reads in the string EECS 2031 "Linux and C" it produces: "EECS 2031 \"Linux and C\""
Ali
Assume that you will design a Hotel Management Software (HMS). What are the objects in a Hotel? List at least 10 objects which need to be stored in the HMS. Abstract those objects and list their properties and behaviours as Class Box Diagram. Find and show at least 2 different inheritance relationship between classes.
Anonymous
Hello everyone, I live in Uzbekistan
Anonymous
I need your help
Anonymous
Are there any people in this group who know the C # programming language?
Anonymous
Please answer me
klimi
Please answer me
Dear Mr. Developer, indeed in this group of over 16k members are present people who have the knowledge of C#. Hope that helps
Anonymous
If I write and use a program in the C # programming language, it will work on my computer But I compilation it to exe file does not work on other computers
klimi
If I write and use a program in the C # programming language, it will work on my computer But I compilation it to exe file does not work on other computers
I would appreciate if you would after trading and accepting the rules follow them. Most of members don't have problem with abiding them. Thanks
Anonymous
I'm sorry, I don't speak English very well
Anonymous
exe file only works for same architecture, you need to recompile for different kind of machine
how i am just starting to learn programming Please Help Meee !!
Anonymous
Lots to learn before asking
I've seen a lot of video tutorials about this but it doesn't help
Prince Of Persia
And google.com
Prince Of Persia
I have learned a lot from them
Anonymous
And google.com
Google doesn’t always help like a living person, so I asked for help from the iss
klimi
What a rule
This is primarily c/c++ group... As stated in the name. Also for your issue, make sure that the second system has the required runtime as that can cause problems on really any system (be it Linux or eh... Windows)
Anonymous
Google doesn’t always help like a living person, so I asked for help from the iss
its normal if exe doesnt work on other computer, you need to make new exe file for new computer
Anonymous
I used to work on these programs before Blender After Effects Premiere Pro Pf Track Boujou Cinema 4D Photoshop and now I am interested in programming and want to learn
Anonymous
klimi
Having Google is nice, having good documentation/manual pages is even better
Anonymous
its normal if exe doesnt work on other computer, you need to make new exe file for new computer
thank you answer i created a setup installation file that should work on other computers too
Anonymous
what error message do you get my friend?
This error occurs on another computer The Installer was interrupted before /Program Name / could be installed. You need to restart the installer try again
Nana
Pls I want to generate random numbers in such a way that there is no duplicate
Nana
#include <iostream> #include <vector> #include <ctime> #include <cstdlib> using namespace std; void intro(); int main() { intro(); vector<int>vect; vector<int>nonRepeat; int size; int num; int min = 1, max = 10; int val; cout<<"\t\tEnter the size of the vector: "; cin>>size; cout<<endl; unsigned seed = time(0); srand(seed); for(int count = 0; count < size; count++) { num = (rand() % (max - min +1)) + min; vect.push_back(num); } cout<<"\t\tHere are the numbers\n"; cout<<endl; for( int count = 0; count < size; count++) { cout<<"\t\tNum #"<<count + 1<<" = "<<vect[count]<<endl; } return 0; } void intro() { cout<<"\t\tThis is a c++ program\n"; cout<<"\t\t----------------------------\n"; cout<<endl; }
Thirty
#rose_as_my_girlfriend
Thirty
#reading-cdecl
Thirty
#best-book
Thirty
#learn
J
This is C++ group. Is there any reason you are still on Win8? Anyway, the solution is Google Android Studio Open the website and download Android Studio for Win8
Long
#ide
Long
#cbook
Md. Sakib
any ans??
Alviro Iskandar
any ans??
no stupid
Md. Sakib
Rupangel, our little princess, has just begun to learn how to count from zero to nine. All she wants to do at this point is counting everything. As a result, her teacher devises a strategy to motivate her. They are going to tell her the first number between 00 to 99 and she has to find the N_{th}N th ​ number of the sequence. The formula to find the next number of A is:- Count the frequency of all digits(DD) and write the frequency(FF) as F_0D_0 F_1D_1 ….. F_9D_9F 0 ​ D 0 ​ F 1 ​ D 1 ​ …..F 9 ​ D 9 ​ without spaces. Ignore F_iD_iF i ​ D i ​ if F_iF i ​ is 00. (i.e: 12231223 -> 112213112213). Assist Rupangel in determining the N_{th}N th ​ number in the sequence. Input The first line of the input is as an integer T(1 \le T \le 2000)T(1≤T≤2000) denoting the number of test cases. Then there will be T lines containing two integers N(0 \le N \le 9)N(0≤N≤9) and K (1 \le K \le 10^9)K(1 ≤ K ≤ 10 9 ). Here, NN will define the first number of the series, and KK will define the position of the number of the series. Output The output will be the number at K_{th}K th ​ position. Sample Input Output 3 1 1 2 1 3 2 Case 1: 1 Case 2: 2 Case 3: 13
Alviro Iskandar
dont spam
Md. Sakib
no stupid
not see next question stupid !
Anonymous
no stupid
lol take a chill pill
Alviro Iskandar
do your homework yourself
Md. Sakib
dont spam
lol take a time
Anonymous
Hello, I have a question. I know that the number of conversion specifiers must exactly match the number of input data. I'm just curious, it was stated that blank spaces are skipped when looking for an integer. int x; scanf("%d", &x); printf("%d", x); input: 3 5 output: 3 expected output: 35 Why is that? I learned that when looking for an integer, it will skip whitespace characters if needed. Furthermore, when an item is matched correctly, the scanning will continue until it matches an item that cannot possibly belong to the item, right? So it will skip the blank spaces after the 3, and it will read 5, yet 5 can belong to x since it is an integer value. I'm just curious about scanf, and I want to learn more about it. I know that if I am going to input two integers, I must add another conversion specifier in the format string. Thanks!
Mario
hi, could someone help me with a program?
♡︎ 𝑅 ꪖ ڶ ㅤ◡̈⃝ㅤ
‌Andriel
hi
coolthought
Union and struct are very similar except the way memory location is stored. So far I have only use struct. Is there a situation where union is preferred or better? Anyone has any experience to share?
Marcio
Union is to be used when you want to treat the same region in memory in different ways. union { char a[2]; int b; } In this case, you can access de 2 byte-information as a vector of 2 char OR as an int, because they occupy the same memory space.
SMS
(they just look similar, seems the only difference is in the keyword.
Krishnaa
class KthLargest { public: int K; vector<int> v; KthLargest(int k, vector<int>& nums) { v=nums; K=k; make_heap(v.begin(), v.end()); } int add(int val) { v.push_back(val); push_heap(v.begin(), v.end()); return v[K-1]; } }; /** * Your KthLargest object will be instantiated and called as such: * KthLargest* obj = new KthLargest(k, nums); * int param_1 = obj->add(val); */
Nana
#include <cstdlib> #include <ctime> #include <iostream> #include <vector> #include <random> using namespace std; void intro(); int main() { intro(); vector<int> vect; vector<int> nonRepeat; int size; int num; int min = 1, max = 10; cout << "\t\tEnter the size of the vector: "; cin >> size; cout << endl; srand(time(0)); while (vect.size() < size) { num = (rand() % (max - min + 1)) + min; vect.push_back(num); for (size_t i = 0; i < vect.size() - 1; i++) { if (vect[i] == num) { vect.pop_back(); break; } } } cout << "\t\tHere are the numbers\n"; cout << endl; for (int count = 0; count < size; count++) { cout << "\t\tNum #" << count + 1 << " = " << vect[count] << endl; } return 0; } void intro() { cout << "\t\tThis is a c++ program\n"; cout << "\t\t----------------------------\n"; cout << endl; }