49,766 Topics

Member Avatar for
Member Avatar for mhalls

Hi I am trying to read a txt file into a 15x30 multi dimensional array. I am having a few problems with the code. This class is embedded within a class and the cout << seat[i][j] seems to work within the loops when I'm reading in the file. When testing, …

Member Avatar for StuXYZ
0
107
Member Avatar for MyRedz

help.why can't my coding loop properly.,..i notice it can't show the loop of ptrpers[j] ? what did i do wrong.? it didn't show back the input i put on earlier. [CODE] #include<iostream> using namespace std; class person { protected: char name[40]; public: void setname() { cout<<"Enter Name:"; cin>>name; } void …

Member Avatar for MyRedz
0
130
Member Avatar for Zcool31

I'm trying to implement a linked list class in a manner similar to STL. Everyithing seems to work fine, but when I try to implement an output operator to let me see what is inside the collection quickly, it starts acting wierd. Note that I use the iterator inside the …

Member Avatar for Zcool31
0
246
Member Avatar for ARYT

Hi everyone This should be one of our last assignments. Well, not sure, but most probably. As the title implies, we're supposed to write a program using multi-dimensional arrays for a 6x6 matrix multiplication. Here's what I've done. It's almost OK; except the most important part which is the final …

Member Avatar for GreenDay2001
0
523
Member Avatar for nassim87

i need the solution to this 3 programs i c++ : 1. Write a program that inputes frome the keyboard an integer x and calculates the sum of all numbers from 1 to x. 2. Write a program that uses a for-loop to output the power of 2 from 2 …

Member Avatar for ithelp
0
80
Member Avatar for timb89

[code] int log2(int n) { int count = 1; while(!n >= 1) { if (n%2 == 0) { count++; n=n/2; } else { count++; n=n/2; floor(n); } } return count; } [/code] not sure why it isnt working?

Member Avatar for timb89
0
122
Member Avatar for Insomniac119

Everything work except for the fact that it cannot solve the whole puzzle, only a few rows. If somebody could just look over the recursive backtracking part of the algorithm, that would be greatly appreciated. Here's the snippet of code that I think is causing me grief: [code] /* @member …

Member Avatar for tux4life
0
1K
Member Avatar for vicky_menonsky

I am trying to write in a file using VC++. my program is to read the entries from the listview and write them in a text file. however i am unable to give newline after each column in listview is written , thus entire listview contents get written in a …

Member Avatar for tux4life
0
85
Member Avatar for dekaya

once I have assigned a file name to a stream object, and no longer have direct access to that file name but I do have access to the stream object is there a way to extract the file name from it? It has to know it because subsequent operations read/write …

Member Avatar for dekaya
0
2K
Member Avatar for coder101

Hi all. I'm a novice with C++ and I'd like to make a program that will present the user with a series of exam questions, most of which are numbers but some of which are descriptions. I want each question to repeat until the user enters the correct response (but …

Member Avatar for WaltP
0
166
Member Avatar for joozi

Im doing a c++ course at uni and one of my questions is to read in an external file, input a number (like 64) then the program will search the file for the number and output how many times the number the user input comes up in the file. here …

Member Avatar for WaltP
0
102
Member Avatar for 0o0

Hello, I'm new to gui programming althou i've done things before in c++ i've always encountered this error and never really tried to fix it. Lets for say I have a counter label and a button that says "Start" when one clicks start the label changes values from 0 to …

Member Avatar for 0o0
0
205
Member Avatar for sautap4u

I AM FACING PROBLEMS WITH SEPARATING SENTENCES FROM A TEXT . FOR eg. if i separate sentence after each '.' then it won't help for Dr.xyz. it would consider them as two different sentences.. but it is not. please help if possible with a suitable code..

Member Avatar for Ancient Dragon
0
269
Member Avatar for student_x

given a queue: queue<int> myqueue; write a function to remove the last entry in the queue. remark: you can't use stack, pointers, or linked list to do that. You can only use functions such as myqueue.pop(), myqueue.front() etc... Anyone has any ideas?

Member Avatar for student_x
0
6K
Member Avatar for saltysnack

Right now im making a converting program for myself. I got it to convert correctly but it only converts one character so here is my code [CODE]map<string,string>datamap; datamap["A#"]="b"; datamap["C"]="DD"; string change; getline(cin,change); for(int i=0; i<change.size(); i++) { //output based on what character gets passed to the map cout << datamap[string(change.begin() …

Member Avatar for GDICommander
0
102
Member Avatar for Argo54325

Hello i have a problem with lineing up each column up correctly, the directories seems to be all messed up. Bellow is my code, a screen shot of the problem is attached to this post. [CODE=C++]if(lSwitch == true) { cout << "\nd: " << setw(15) << right << "" << …

Member Avatar for GDICommander
0
97
Member Avatar for Tigran

Hello, A few days ago I visited a lecture of a teacher in an university that was about parallel processing. He explained why it's good etc, and how you can make programs that use multiple cpus in C. He used MPI and the code looked nice, wasn't too hard and …

Member Avatar for tux4life
0
94
Member Avatar for seao111

Hi, i am trying to make a general compression algorithm in c++ but i haven't really gotten the i/o part of this right yet. What i want to do somewhere along the line is to have my program parse say 10 or so characters at a time from a binary …

Member Avatar for seao111
0
163
Member Avatar for Helgso

This program is "C:\test\program.exe": [code]#include <iostream> #include <fstream> using namespace std; int main() { int choice; cout<<" Which name to embrace?\n\n"; cout<<" - 1. Fight Club\n"; cout<<" - 2. Shawshank Redemption\n"; cout<<" - 3. Italian Job\n"; cin>> choice; }[/code] There's also a .txt file there named file.txt, "C:\test\file.txt\". Inside this …

Member Avatar for tux4life
0
219
Member Avatar for phouse512

Hello, I'm learning to start to program in C++, and I have a problem with the prompt closing before the program ends. I know there's a lot of info about it, and I've googled it and searched here, but all the solutions to system("pause") don't work for me. I'm using …

Member Avatar for phouse512
0
105
Member Avatar for mimis

Hello, I have seen many problems that inputs an unknown size of tests and i have to output the result of each test. An example is here: [QUOTE] The Input The input will consist of a series of pairs of integers i and j, one pair of integers per line. …

Member Avatar for mimis
0
184
Member Avatar for edb500

Ok i have a parent class called MobileAccount, it has a public method called void PrintAccountInfo(), and within this PrintAccountInfo() method I call a private method called void PrintAccountType(). Now as I mentioned the parent class called MobileAccount has a subclass called AdvancedAccount, it too has a method called PrintAccountInfo() …

Member Avatar for ArkM
0
80
Member Avatar for senaddor

Hello. I am having hard time understanding recussion in binary search tree. Assuming we have 6,4,7 in our tree the following inorder function should print 4,6,7 and I don't understand how it's done. Can somebody help explaining in more detail. Thank You. [code=cplusplus] void BinarySearchTree::print_inorder() { inorder(root); } void BinarySearchTree::inorder(tree_node* …

Member Avatar for Narue
0
177
Member Avatar for rafkay

Hi Guys, this is searching coding. I needs to ;- - read data from file - DONE - bubble sort - DONE - to find the data (searching) - [B]undone.[/B] can anyone help me to find the error in my coding.. coz when i run my program, my algorithm [B]void …

Member Avatar for tux4life
0
94
Member Avatar for lauren316

Can anyone tell me what I am doing wrong in this code? The output window allows me to input the string, but does not output whether or not it is a palindrom. There are no build errors Thanks in advance! Lauren [code] #include <iostream> #include <deque> #include <string> #include <cctype> …

Member Avatar for rahul8590
0
691
Member Avatar for Argo54325

Ok I need some fast help with this, I'm trying to get a regular expression to work with my file system. this is what i currently have, but it seem to crash on, boost::regex expr(regex); [code=c++]void show_files (const path & directory, bool recurse_into_subdirs, bool lSwitch, bool rSwitch, bool aSwitch, string …

Member Avatar for Argo54325
0
187
Member Avatar for Beevee

Hi, Just a quick simple question, I have done some googleing and have been unable to find a conclusive answer, But is it possible to use the XAudio2 API (DirectX) to capture sound as well as play sound? I am planning a project where I need to play and capture …

0
38
Member Avatar for monocog

Nucleon was nice enough to provide me with the following code to help learn lists a while back. I've had a little more time to revisit lists again and would like to see what this code looks like using a linked list instead of an array.. This is NOT homework, …

Member Avatar for Lerner
0
95
Member Avatar for rahul8590

Well i just want to find out , that is there any way where we can find out the various functions and operators / keywords present in a particular header file ....?

Member Avatar for rahul8590
0
121
Member Avatar for beddy085

The End.