49,756 Topics

Member Avatar for
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
498
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
330
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
184
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
82
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
225
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
262
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
98
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
174
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
180
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
479
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
264
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
780
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
Member Avatar for meme meme

please help meeee write a program for a local bank to manage their accounts. the bank offers two account types,saving and checking,each customer must maintain a minimum balance, if the customer`s balance falls below the minimum ,ther is a service charge 10 aed for saving and 25AED for checking. the …

Member Avatar for paradise11
0
170
Member Avatar for dark_sider_1

Hi there, I've been looking to figure out what a USB port does when it's overloaded by too much bandwidth (?), and it the port just shuts down, right? Might you have any ideas on where to look/what to look for with USB research? Is it even possible to automatically …

0
96
Member Avatar for zhengcyy

I'm creating the a Card game c++ program and I got some problem. PLZ help!! I got few files: Main.cpp (ask user which card game he want to play) Card.h (creat rank and suit for cards) War.h, War.cpp (creats War game) TicTacToe.h, TicTacToe.cpp (creats TicTacToe game) Game.h, Game.cpp (required to …

Member Avatar for DeanMSands3
0
392
Member Avatar for claywin

Hi everyone, I've been having some troubles with this code (I'm a beginner). All errors are resolved and it runs, but as soon as it starts it says "main.exe has stopped working" and closes. I'd appreciate if someone could look over it and tell me what's wrong. main.cpp: #include "SDL/SDL.h" …

Member Avatar for Labdabeta
0
1K
Member Avatar for Lucaci Andrew

I was wandering what could be the causes of this error message? Like in general. `\\: *stopped,reason="signal-received",signal-name="SIGSEGV",signal-meaning="Segmentation fault",frame={addr="0x00402d53",func="Domain::Movie::show",args=[{name="this",value="0x1"}],file="..\\src\\Domain\\Movie.cpp",fullname="e:\\eclipse for c++\\workspace\\lb6-8oop\\src\\domain\\Movie.cpp",line="36"},thread-id="1",stopped-threads="all"` 10x.

Member Avatar for gusano79
0
704
Member Avatar for SanRubik

Our hardworking chef is bored of sleeping in his restaurants. He has decided to settle down. The first thing he must do is to find a suitable location to build a palatial home. Think of the city as a two-dimensional grid. There are N restaurants in the city. Each of …

Member Avatar for DeanMSands3
-1
135
Member Avatar for eng_m

Hi guys. so I have been trying to solve this problem and I wrote a bit of which I think its part of the solution. so I would apreciate a help from you guys. The problem: A palindrome is a word, phrase, or any other sequence of letters that can …

Member Avatar for SanRubik
0
179

The End.