49,757 Topics
| |
iam trying to optimize a code i want to run code for arm_no=1000, its running for 100 arms but further increasing causes segmentation fault core dumped. to run the code use $ g++ Epsilon_greed.cpp -lm `gsl-config --libs` $ ./a.out but you'll have to install libgsl0 i.e gnu scientific library. #include<stdio.h> … | |
is this is the correct way 2 write destructor of copy constructor and parameterised constructor ~a(int x,float y) ~a(a &a1) | |
**I am new in Visual C++ 2008. here is a project which is alredy developed and this time under maintence. In this project there are 5 projects which one one project is depend on another example a,b,c,d,e are 5 projects and b depends on a,c depends on b i.e --a-->b-->c-->d-->e. … | |
fstream f; char ch; int i=0; string word,word2[200]; f.open("op3_sort.txt",ios::in|ios::out); if(!f) cout<<"\nUnable To Open File!\n"; else { cout<<"\nLet's View D Content!\n"; while(!f.eof()) { getline(f,word,'\t'); word2[i]=word; i++; cout<<word2[i]; } } cout<<"\nShowing Data Now\n"; for(int a=0; a<i; a++) { cout<<endl; cout<<word2[a]; } | |
Hi everyone! I would like to know how to create a xml file and display it in a fixed location other than the console, I have successfuly create and display it in the console, what I want is to display in the following location C: \ Users \ abdelhalim \ … | |
hi! i want to concatenate a string with an integer that's why i used this code : ++k; char f[50]; sprintf(f,"%d",k); strcat ( f,"N"); but what i got is this ( for example :**1N**) and what i want is some thing like this : **N1** Could you please help me … | |
I can not get a sum from a function and return to main to check whether the sum is greater than the money added in and input more money. int vending::MakeSelection(int ItemPrice[], int NumItems[], int sum){ int response; do{ cout << "Item:"; cin >> response; if(response == 1){ for(int i … | |
I've got a problem understanding inheritance. #include <iostream.h> class A { public: int x; }; class S1: public A { public: int x; }; class S2: public S1 { public: int x; }; int main() { S2 obj; cout << obj.x; return 0; } In the code above, I basically … | |
Here is my assignment. I would like someone to walk thru some of this with me if you have time today. This is my last assignment and I just dont understand parallel arrays and how to recall information. If someone could help me get started that would be a big … | |
I am getting garbage values for this program.. Please help. /* =============== == Program 8 == =============== Q. Write a program to enter and print student's details (Personal, Academics and Skills) using multiple inheritance */ #include <iostream.h> #include <string.h> #include <stdio.h> #include <conio.h> class skills { public: char hobby[]; char … | |
I've a text file : Random.txt which comprises of Jade 12MS234 Male 18 Rocky 12MS324 Male 18 Marx 12MS632 Male 18 Now in my program i've a class class stud ( char name[10] char reg[10] char gender[10] int age ) Now I've to write a code in c++, where i've … | |
Hi! I have written a code to subtract 2 large integers stored in arrays! But the problem is, its not working when the minuend is smaller than the subtrahend, i.e, when the answer would be negative. I am taking 2 char arrays as parameters, converting them to int arrays, working … | |
How to compute current ratio in C++ with using header file? Calculate in c++ program with *3* different file. **- 2 file (cpp file) - 1 file (header file)** Information: formula---> **Current ratio = current asset / current liabilities** Please correct me If I'm wrong. I just start study C++ … | |
Hi everyone.. :), me again. I've never used Linked Lists.. They don't make sense to me. I kind of understand them though. There's plently of online explanations explaining what they are but they all go down the same path. I'm trying to undertstand how one Note (via the next pointer) … | |
I'm attempting to implement the Factory Pattern. I have a class called "Window" which has a class member function which determines which object is being called and then assigns the particular object pointer. I have written the following code: class Hamming { public: Hamming() { } Hamming(int theSize) { // … | |
Because things, these days, seem a little 'slow' around this forum, please forebare this old post, (that was recently resurrected by an inquiring mind), and humour this 'update', in good faith that this update might be appreciated by some beginning students of C++ ... :) // beginnerBadCppExampleCodeBeforeFixedUp.cpp // 2013-08-14 // … | |
Hi guys, I'm working on a side project for a friend and I'm looking for a C++ library that allows me to put bunch of paragraphs in a PDF format. Anyone know any good libraries that can do this as simply as possible? It will be just paragraphs and paragraphs … | |
i've being trying to fix the error in my code for quite some time but am unable to resolve one or two of the errors like expected primary-expression before 'public' main.cpp:211:22: error: expected ';' before 'public' main.cpp:216:23: error: expected '}' before 'else' i am a beginner in programming # include<iostream> … | |
Hi Im trying to create a random 2D array (3 x 3) so that numbers 1-9 will randomly be placed in the grid behind the '?' shown in coveredarray but in the guessarray just wanted to know if im doing right, im faily new to C++, also i wanted how … | |
| This simple program of pointer generating THREAT Warning and identified as MALWARE. I dont see HOW ? #include<stdio.h> #include<conio.h> #include<iostream.h> int main() { int num; int *ptr; ptr=# cout<<ptr; cout<<ptr++; cout<<ptr; cout<<sizeof(num); getch(); } ![3283bd99afe1c651a274377d4deb3f45](/attachments/large/4/3283bd99afe1c651a274377d4deb3f45.jpg "3283bd99afe1c651a274377d4deb3f45") Thanx. |
Sorry if this is hard to understand what I'm trying to do here, but, I do not know how to approach this. I am using method overloading in my constructors of a class, and I have multiple "Window" functions which are all classes that can be used and I need … | |
Hi Im trying to create a random 2D array (3 x 3) so that numbers 1-9 will randomly be placed in the grid behind the '?' shown in coveredarray but in the guessarray just wanted to know if im doing right, im faily new to C++, also i wanted to … | |
hi. i am marsh a student guys i have a activity but i don't know to start it with a loop. can you help me? ***** ***** **** **** *** *** ** ** * * ** ** *** *** **** **** ***** ***** | |
I am facing a logical error in the function filewrite() but i cant figure it out, it all seems right. The sum of the array elements is shown on the screen but when it is written in the file, it is not in the correct format. #include<iostream> #include<cstdlib> #include<fstream> using … | |
Hi I was wondering if someone could tell me what I am doing wrong. I am trying to call the age function from the person class within the PEmployee class. but the name does not display and the age states 0. thank you for any insight you may give me. … | |
1. Write the definitions of the following methods for the class doublyLinkedList a. copyList b. copy constructor c. function to overload the assignment operator d. destructor Also, write a program to test the copy constructor and the assignment operator methods of the class doublyLinkedList. #ifndef H_doublyLinkedList #define H_doublyLinkedList #include <iostream> … | |
I read somewhere that when you develop a kernel in c++, that the new, delete and static_cast keywords require timing references... I was unable to find the site again but my question is, why does these keywords require timing references? | |
I want to use it because it says it supports all the C++11 features and I'm hoping that includes Regex as well since gcc isn't near finishing anytime soon.. However, many other websites are saying that clang requires Mingw/gcc to be used in the first place. It doesn't make any … |
The End.