49,757 Topics

Member Avatar for
Member Avatar for HelloMe

Hello again :) I had this project (first block of codes below) and out of this program i have to do the same again but this time using functions. My problem now is, i made some functions ( i hope these are functions) but on the last part (the one …

Member Avatar for HelloMe
0
78
Member Avatar for fjrivash

Dear all, is there is a way to go trough a matrix using just one "for" loop?, I mean I have this snippet: [CODE] #define WIDTH 5 #define HEIGHT 3 int mat [HEIGHT * WIDTH]; int n,m; int main () { for (n=0;n<HEIGHT;n++) for (m=0;m<WIDTH;m++) { mat[n*WIDTH+m]=(n+1)*(m+1); } return 0; …

Member Avatar for fjrivash
0
86
Member Avatar for Nikhar

Hey guys...Can you please help me explain what does returning an istream object mean. I am currently studying Accelerated C++ and at many places a function returns istream object. What does it mean? For example:- [CODE]istream& read(istream& is, Student_info& s) { // read and store the student's name and midterm …

Member Avatar for Nikhar
0
2K
Member Avatar for Afupi

My project requires I use the right-hand method of solving a maze. I have to use a stack to keep track of and eventually print out the path to the exit. I know the way I am trying to keep track of each point is wrong because using mazeArray[xCoord][yCoord] is …

Member Avatar for Afupi
0
225
Member Avatar for edherbs135

Just wondering if there was any kinda way of doing this kind of filtering based on comparison other than having to go through each position in an array one by one comparing it to every position in the other array. If I'm to vague and you need more information let …

Member Avatar for edherbs135
0
79
Member Avatar for Lukezzz

If you would convert these 3 examples to a string you would get an errormessage as no of the numbers are valid numbers. How would it be possible to do a check programatically if the number is a valid number before a conversion ? [code] String^ GetValue = ""; GetValue …

Member Avatar for fjrivash
0
136
Member Avatar for prakashmishra84

hi guys.. i need ur help badly . i need to implement the following project in c++, using oracle 9i as backend. but i dnt have any clue .. whr to start frm and how. please suggest me a possible lay out for this requirement. and i have also an …

Member Avatar for vyas lal yadav
0
144
Member Avatar for dumrat

I declared this inside one function: [CODE] void function() { .... static const int iLimit = GetLimit(); int iL = a_MyArray[iLimit]; .... } [/CODE] The code compiles ok in g++. What I want to know is whether the GetLimit function will be called only once (At the first call to …

Member Avatar for dumrat
0
92
Member Avatar for HelloMe

Hello everyone... I have a problem on the last part of my codes. This programm supposed to accept several kind of courses and its corresponding grades. So far so good... but when it comes to display the courses and the grades and its remarks of passed or failed, the programm …

Member Avatar for Seten
0
123
Member Avatar for sush27

can someone pls post some tutorials or articles on "how to use mschart for plotting xy graph in vc++". thanks in advance :)

Member Avatar for kvprajapati
0
70
Member Avatar for samsons17

Hi....I got a simple question here which i dont know how to solve... [B]Question[/B] Type casting is common in writing programs. It converts from one data type to another, for example from integer to double or float. Write a complete C++ program which uses casting, which will ask the quantity …

Member Avatar for jonsca
0
149
Member Avatar for Doughnuts

Hi everybody, I have a problem with output files. I have installed Code::Blocks and MinGW, replacing my old Borland compiler. I am trying to make a program that uses arrays and files: [CODE]#include <iostream> #include <fstream.h> #include <conio.h> #include <string> #include <stdlib.h> #include <cassert> using namespace std; void Save(ofstream& f, …

Member Avatar for bamcclur
1
112
Member Avatar for ShadowScripter

Hey, throwing a quick question in here: Is there a way to get the value at a cursor's location? For instance, the cursor is at {0,20} and I decide to do cout<<"Foo" then I move my cursor to {0,10} do something else and then come back to {0,20}, and I …

Member Avatar for technology
0
2K
Member Avatar for devo_99

I have been working on this program to count the number of zero's odd, and even numbers that a user inputs. I have tried different variations and cannot get it to go, I keep getting linker errors and cannot see where the problem is. I am new to this and …

Member Avatar for devo_99
0
172
Member Avatar for PDB1982

I'm working on a program where I need to input a file with 5 candidates names and votes, and output the name, votes, and the percentage of total votes that candidate received, as well as the overall winner. Right now I've been able to create some arrays and output the …

Member Avatar for jonsca
0
129
Member Avatar for sexyzebra19

Hi all, For have implemented a program that performs the bisection method, currently with the user entering the initial interval to find one root. However I was wondering if I could get the program to find the intervals automatically without the users input. The only way I can think to …

Member Avatar for jonsca
0
91
Member Avatar for Frap

Hi while doing my homeworks, i stucked here .. Writting a program to calculate the factorial of positive integer . here is my code: [CODE] int main () { int x,factorial; cout<<"Enter an integer to calculate its factorial: "; cin>>x; if (x==1 && x==0) { cout<<"\nThe facotrial is: 1"; } …

Member Avatar for donaldw
0
97
Member Avatar for itzaaron

why is only my first class working? when i run this it just asks about the viruses and not the cost of the OS. [CODE]#include <iostream> using namespace std; class OperatingSystem { private: float cost; public: OperatingSystem() : cost(0) {} float getCost() { return cost; } void setCost(float cost) { …

Member Avatar for GrubSchumi
0
85
Member Avatar for astroshark

Hi I manage to create some code to where it will read in a set of exam scores and display their category as well as if they enter an invalid number it repeats the code until the data is valid or until they enter the SENTINEL value but when I …

Member Avatar for astroshark
0
94
Member Avatar for PDB1982

How do I make an array to find the largest portion of another array? I am trying to find the candidate that received the largest amount of votes from the following file: Johnson 5000 Miller 4000 Duffy 6000 Robinson 2500 Ashtony 1800 here is my code: [code] #include <iostream> #include …

Member Avatar for Clinton Portis
0
129
Member Avatar for big_guy_bri

We are working on a header file for a template class called TreeNode. My class definition is as follows: [CODE]#include <iostream> using namespace std; template <class T> class BSTree; class TreeNode<T>; { friend classBSTree<T>; public: //constructor TreeNode( T = T(), TreeNode<T>* = 0, TreeNode<T>* = 0 ); private: T data; …

Member Avatar for Narue
0
104
Member Avatar for Trekker182

Hello everyone, I'm trying my hand at the strategy design pattern. I've got most of my code working, however, I keep running into two errors "invalid use of undefined type `struct sortStrategy' " strategy->sort(students); "forward declaration of `struct sortStrategy' " strategy = s;} I did a google search on both …

Member Avatar for Trekker182
0
144
Member Avatar for Darth Vader

I wonder if there is any function that returns the difference in minutes for examples like this: 1300-1515 (135 minutes) 2350-0100 (70 minutes) Is there any timefunction that can have the ability to return the minutedifference ?

Member Avatar for Excizted
0
83
Member Avatar for T-Dogg3030

Part of the assignment I'm working on is to display random letters between my good letters to encode text. Right now I can make it display random numbers. How can I change this to out put random letters? [CODE] #include <iostream> #include <fstream> #include <ctype.h> #include <ctime> #include <cstdlib> #include …

Member Avatar for mrnutty
0
277
Member Avatar for T-Dogg3030

I am trying to do a command line switch with an if statement. The problem I am running into is when I am using a letter, it wont recognize it. When I use a number, no problem. I think there are a few different ways to solve this. Can anyone …

Member Avatar for programmersbook
0
98
Member Avatar for j_williams18

Can anyone help me. I have a c++ project to do. The program must simulate a vending machine. I will post what i have so far. a data file must be hardcoded into it which provides the different drinks.[code]#include <iostream> #include <fstream> #include <string> using namespace std; const int SIZE=54; …

Member Avatar for j_williams18
0
603
Member Avatar for Stefano Mtangoo

please help me with this error: [COLOR="Red"]obj\Release\main.o:main.cpp:(.text+0x1c)||undefined reference to `__imp__CreateCWMp3@0'|[/COLOR] what is missing? I'm trying to compile [URL="http://www.inet.hr/~zcindori/libwmp3/index.html"]this[/URL]

Member Avatar for Stefano Mtangoo
0
237
Member Avatar for jacline

Hi to all, I have a homework about a banking system. I try to adding a branch in an array and the size of array dynamically increased. Here is my code but it gives run time error. [CODE]#include "BankingSystem.h" #include "Branch.h" #include <iostream> using namespace std; BankingSystem::BankingSystem(){ size=0; branches=NULL; } …

Member Avatar for jacline
0
12K
Member Avatar for iDevelop

I'm new to using C++ but I thought I would give it a try. The goal is to delete all files and folders located in %userprofile%\Local Settings\Temp without deleting the folder called "Bluezone" located in the Temp folder. Any help would be appreciated.

Member Avatar for Excizted
1
94
Member Avatar for Sseeth

[CODE]string lastNames(string name[],int SIZE){ stringstream ss; for(int i = 0; i < SIZE; i++){ ss << '"' << name[i].substr(0) << name[i].erase(name[i].find(',')) << '"' << " "; } return ss.str(); }[/CODE] this is outputting my list of names correctly other than all the names come out twice like "namename" how can …

Member Avatar for Sseeth
0
100

The End.