49,761 Topics
| |
I have a C++ console project in Code::Blocks and I have set breakpoints to test an error. I have set the build for the project to produce debugging symbols for the debug build. I built it, then when I hit debug it just ignored my breakpoints and skipped to the … | |
Hi, I'm trying to write a function that enlarges a dynamically allocated array, but I am having some trouble doing so. Here's my code: void enlargeArray(int *oldArr, int arraySize) { //oldArr is a dynamically allocated array int *newArr = new int[arraySize*2]; //copy the elements from oldArr into newArr delete oldArr[]; … | |
Hi, I am trying to create a programe like this: n1 = NAttrib() n2 = NAttrib() out = NAttrib() NAttrib class can be considered as general purpose attribute. f1 = FloatAttrib(1.0) f2 = FloatAttrib(2.0) FloatAttribute class is like float type but with some extra spices. It has operator overloading functions … | |
//PROGRAM TO FIND DERIVATIVE(FIRST AND SECOND)OF POLYNOMIAL FUNCTIONS #include<iostream.h> #include<conio.h> void main() { int i,d,coeff[100],degree[100]; clrscr(); cout<<"\nEnter the degree of the polynomial : "; cin>>d; for(i=d;i>=0;i--) { if(i>1) { degree[i]=i; cout<<"\nEnter the coefficient of x^"<<degree[i]<<" (with sign) : "; cin>>coeff[i]; } else if(i==1) { degree[i]=i; cout<<"\nEnter the coefficient of x … | |
matrix operation please help me coding this in c++: - Inverse matrices. - Calculate matrix determinant. - Set a row or a column of the matrix to a certain value. - Calculate performance (time and memory taken by each algorithm). | |
hi im currently learning about linked list. Ive created a code which is supposed to let you type some numbers, then display them. i did this mostly by using information on the internet(code examples) and such. Hence there are obvious mistakes a bits i do not understand. Here is my … | |
Hello, I'm working on an assignment that requires me to do the following: "A file contains 6 numbers per line and contains several records. Another file contains 3 numbers per line and several records. Write a program to input each of the numbers, find the highest number, the lowest number, … | |
#include <string> #include <cstdlib> typedef enum {Dominion, Sobeys, Shoppers, Walmart} Store; using namespace std; class Item { private: // name of the item (non-empty string) string name; // number of dollars in price of item int dollars; // number of cents in price of item int cents; // store where … | |
//TO FIND INVERSE OF A MATRIX #include<iostream.h> #include<conio.h> #include<math.h> #include<graphics.h> #include<iomanip.h> float A[3][3],B[3][3]; int i,j,k,l,m,n,e,f,g,h; float det=0; void main() { clrscr(); cout<<"Enter the 3x3 matrix :\n";//Enters the matrix for(i=0;i<3;i++) for(j=0;j<3;j++) cin>>A[i][j]; //To find cofactor and determinant for(i=0,k=1,m=2,e=-1,g=2;i<3;i++,e++,g--,k-=g,m-=e) { for(j=0,l=1,n=2,f=-1,h=2;j<3;j++,f++,h--,l-=h,n-=f) { B[i][j]=pow(-1,(i+j))*((A[k][l]*A[m][n])-(A[m][l]*A[k][n])); if(i==0) { det+=A[i][j]*B[i][j]; } } } cout<<"The determinant of … | |
hello! I have a function with the following definition: void functionName(void** a); When I want to call that function how am I supposed to send the arguments? | |
I have noticed the foolowing details regarding fstream. the following combination of openstate flags do not truncate the files. ios_base::out | ios_base::in | <any flag other than ios_base::trunc> ios_base::out | ios_base::app | <any flag other than ios_base::trunc> the following combinations are resulting in a failbit ios_base::app ios_base::ate ios_base::app | aos_base::ate … | |
I need to create a program that uses a structure that alocates memory with the new operator. The information must be saved in a file, then displayed. The problem I have is that the program saves only the first character of the words I enter. Could someone please help me … | |
Hello. All i am having trouble with using public ref classes and gcnew. The following code will show you my situation. Vector2 class /// </summary> public ref class vector2{ public: vector2(void):x(""),y(""){}; System::String ^x; System::String ^y; void Position(System::String ^ X, System::String^ Y){ x=X; y=Y; }; }; Add picture class public ref … | |
hi guys.... i make a program with Dev-C++ ..... let say my program is already running now .... if i try to open it ... it show me a MessageBox or an output to tell me i can't run it when is already running | |
Hi, everyone. Hope you can help me to answer the question, i am not familiar with recursive function...and i hope someone could help me.. Shift elements means e.g. array[ ] = {1, 2, 3, 4, 5, 6}; if the user input a value, say 2, the array will become {5, … | |
I'm trying to upgrade my class library to my current mathematical skill set and am having trouble with multi-term polynomials, especially those I where I don't know how many terms the user will be putting in. I know that the formula for the first derivative of a polynomial is ax^n … | |
#include<dos.h> #include<iostream.h> #include<stdlib.h> #include<conio.h> #include<stdio.h> #include<string.h> #include<graphics.h> int y; int i; struct element{ char name[20]; int at_no; double at_wt,at_r,en,ion,density,mp,bp; char ato_wt[20],ato_r[20],eno[20]; char iono[20],densityo[20],mpo[20],bpo[20]; char crs[20]; char sym[4]; char earr[100]; }E[118]; void numberfind(int); void numrfind(int,int); void massfind(double); void namfind(char*); void namlfind(char); void massrfind(double,double); void ionifind(double); void ionirfind(double,double); void enegfind(double); void enegrfind(double,double); … | |
[Moderator edit: 3500 lines of code removed as it was totally irrelevant to the question and severely affecting load time of the page] | |
I am downloading content from a web source using URLDownloadToFile winapi function All is well, with that, the content is downloaded to the correct path. My probems start when I try to read it, like below, the loop never exits. myReadFile.open(sFile); if (myReadFile.is_open()) { while (!myReadFile.eof()) { //code; } } … | |
I continue to use the same C++ libraries for COTS software that we use in my company. Their help files aren't great and when I send queries directly to the company it can be weeks or possibly months before I get a response. This, I think, is a simple problem … | |
I'm currently trying to extend my student class with a course class & by extending the driver.cpp to enrol 3 students into the course. However, i've gotten some errors & can't seem to figure whats wrong with them, i might have missed out something. I was hoping to get some … | |
So; I have to determine if there is a) 3 of a kind b)4 of a kind c)straight. I have put the 7 cards into a 1 dimensional array and sorted them but I also need a case for not being more than 4 cards. I don't need to include … | |
The code is really long so I don't want to post all of it, but I'm posting the part I'm having an issue with. This is part of a fraction class I'm writing. Most of it is working but for there is something wrong with the istream because when I … | |
I'm trying to convert My Console classes to .Net classes because I can't use std::vector or anything like that in WindowsFormsApplications. So I decided to convert all Vectors to Lists and I thought that the classes work the same but my code below throws a massive amount of errors and … | |
Can anyone help me with how to work on Eclipse C++ IDE? I need a clear set of instructions on how to connect server and database as well as how to compile and run standalone codes? | |
Hello ! I'm writing a program in C++ and I use a struct definition named Contact. In a function in my program that returns an item of type Contact,i face the problem below: Contact getContact(){ Contact c; //do things if(condition) //assign c else //c is not assigned return c; } … | |
So let me start by saying that I am a complete beginner when coding in C++ windows/forms program. I was able to get my SQL database connection up with my program. I've ran some simple tests and it looks like my program is able to do simple queries such as … | |
#ifndef EXAMPLE_HPP #define EXAMPLE_HPP #include <memory> #include <boost/gil/gil_all.hpp> #include <QtGui/QApplication> #include <QtGui/QHBoxLayout> #include <QtGui/QImage> #include <QtGui/QLabel> #include <QtGui/QWidget> //#include "image_details.hpp" static void x_gradient(boost::gil::gray8c_view_t const &src, boost::gil::gray8s_view_t const &dst) { for (int y = 0; y != src.height(); ++y) for (int x = 1; x != src.width() - 1; ++x) dst(x, … | |
can anyone kindly help me in writing a program for creating an address book. Its kinda urgent and I ll be really grateful. program description: develop a program for an address book.single entry in an address book is called a contact, which can have any of the following fields, 1. … | |
Hi, I have a large array of values and would like to find a way to calculate the change in value for each period. I have been attempting to use a for command with an array to do this, but I have not been successful at all. The basic idea … |
The End.