49,761 Topics

Member Avatar for
Member Avatar for Labdabeta

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 …

Member Avatar for Goemon
0
9K
Member Avatar for binningen

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[]; …

Member Avatar for mike_2000_17
0
165
Member Avatar for mayapower

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 …

Member Avatar for mike_2000_17
0
252
Member Avatar for nitinmbhanu

//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 …

Member Avatar for mike_2000_17
0
1K
Member Avatar for rahulraj9

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).

Member Avatar for nitinmbhanu
0
154
Member Avatar for BryantFury

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 …

Member Avatar for BryantFury
0
167
Member Avatar for greencode

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, …

Member Avatar for WaltP
0
323
Member Avatar for AlvinLiu

#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 …

Member Avatar for AlvinLiu
0
501
Member Avatar for nitinmbhanu

//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 …

Member Avatar for nitinmbhanu
0
2K
Member Avatar for noscimo

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?

Member Avatar for deceptikon
0
160
Member Avatar for maharjun

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 …

Member Avatar for TTTHXC
0
333
Member Avatar for JohnQ002

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 …

Member Avatar for Saith
0
185
Member Avatar for jonnyboy12

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 …

Member Avatar for thines01
0
142
Member Avatar for Carolin

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

Member Avatar for JGorard159
0
83
Member Avatar for runstreet

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, …

Member Avatar for nitinmbhanu
0
2K
Member Avatar for lxXTaCoXxl

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 …

Member Avatar for lxXTaCoXxl
0
297
Member Avatar for nitinmbhanu

#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); …

Member Avatar for DeanMSands3
1
233
Member Avatar for nitinmbhanu

[Moderator edit: 3500 lines of code removed as it was totally irrelevant to the question and severely affecting load time of the page]

Member Avatar for nitinmbhanu
1
263
Member Avatar for Suzie999

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; } } …

Member Avatar for Suzie999
0
99
Member Avatar for IMJS

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 …

Member Avatar for Ancient Dragon
0
175
Member Avatar for ashboi

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 …

Member Avatar for Lerner
0
181
Member Avatar for henri18

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 …

Member Avatar for Lerner
0
480
Member Avatar for FraidaL

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 …

Member Avatar for FraidaL
0
134
Member Avatar for triumphost

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 …

Member Avatar for triumphost
0
182
Member Avatar for rony.united7

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?

Member Avatar for DeanMSands3
0
160
Member Avatar for noscimo

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; } …

Member Avatar for noscimo
0
267
Member Avatar for yongj

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 …

Member Avatar for thines01
0
785
Member Avatar for stereomatching

#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, …

Member Avatar for stereomatching
0
297
Member Avatar for kumarprashant

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. …

Member Avatar for deceptikon
0
4K
Member Avatar for NunsBeachSurfer

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 …

Member Avatar for NunsBeachSurfer
0
194

The End.