49,761 Topics

Member Avatar for
Member Avatar for HenryR7

cout << "Enter the filename " << endl; cin >> filename; inFile.open(filename); int length = 0; while (inFile) length++; IntStack stack(length); I keep getting an error and I have no idea why. Can someone explain what is going on with it? After I input the the filename, program terminates. My …

Member Avatar for richieking
0
186
Member Avatar for jonathan710

// Expect to print values of arr[0] to arr[4] #include <iostream> #include <vector> using namespace std; int main() { vector<int *> ptrList; int arr[] = { 0, 10, 20, 30, 40 }; int * ptrArr = arr; for( int i=0; i< 5; i++ ) { ptrList.push_back( ptrArr+i ); } vector<int …

Member Avatar for nullptr
0
258
Member Avatar for cambalinho

cout << *static_cast<int*>(test); test is a void pointer pointed to an int variable. if i use: cout << *static_cast<char*>(test); i get just 1 character. so how can i print the value directly to string? if i use the string i get an memory error

Member Avatar for cambalinho
0
5K
Member Avatar for jonathan710

Hey guys...so for my homework i have to do this...would it be possible if someone helped me with this? Not very familiar with maps and stuff like that yet...thx a lot! So here's the question: Suppose there is an application that allows users to enter a phone number to search …

Member Avatar for Ancient Dragon
0
148
Member Avatar for ariel930

Hi,I am having a hard time trying to do insertion sort on a singly link list containing single alphabets.I have spent hours doing this but still it wont work.Any help will be apprecited. Here is my code: # include <iostream> using namespace std; class node { public: char info; node …

Member Avatar for richieking
0
5K
Member Avatar for Tyler_1

The title says it all but I am curious if it's acceptable or even efficient for that matter. If others were to read my code or work on a project with me is this generally accepted among others or yourself if you work on an enterprise level? Is this memory …

Member Avatar for Tumlee
0
316
Member Avatar for saja.omarii.7

heyyy every one .. can u guys write a c++ program to draw lozenge?? i tried to draw square triangle etc..

Member Avatar for saja.omarii.7
0
104
Member Avatar for castajiz_2

As it is said in the title i can not get the keyword string. I finally found a version of C for windows 8 but now i can t get the most important thing types int, double char,bool ect... work perfectly and always show as a keyword but somehow i …

Member Avatar for Ancient Dragon
0
291
Member Avatar for karthick_pmk

Hi i am new to VC++, iam trying to implement the encoding of password **In Java ,** **byte[] saltedPassword = (password + getSalt()).getBytes();** **output :** ** SaltedPassword :[B@3eca90** in Java, saltedPassword get encoded value in the same way **i want to implement in VC++** How to do **Encoding in VC++**..? …

Member Avatar for Ancient Dragon
0
206
Member Avatar for H_beginner

I am trying to plot a graph in matlab using c++. But the matlab is only giving me an empty graph. void portfolio::viewGraph() { double value[20]; //store portfolio value double time[20]; //store time int i=0,j=1; double cash,p; ifstream in_file("transactionhistory.txt", ios::in); string c; while(in_file>>cash>>p>>c>>c>>c>>c>>c) { value[i]=(p+cash); cout<<p<<endl; time[i]=j; cout<<time[i]<<endl; i++; j++; …

0
176
Member Avatar for andrew mendonca

Working on the maze program, with '*' indicating a wall, ' ' indicating a corridor, and '#' indicating a solution path, where I must use a recursive backtracking algorithm, I cannot seem to print the '#' symbol for the solved maze. Here is my new code: #include<iostream> #include<fstream> using namespace …

Member Avatar for kal_crazy
0
249
Member Avatar for mc3330418

I need to read in sentence and then put each letter into an arraylist. When I'm done I need to out put the letter that were in the sentence and how many times they appeared. ex: hello how are you h2 e2 l2 o3 w1 r1 y1 u1 So, I …

Member Avatar for mc3330418
0
191
Member Avatar for batoul.dje

a set will be represented by the list of its components, writing a difference function set list i don't how how i do it in c++ please can u help me

Member Avatar for richieking
0
109
Member Avatar for NathanOliver

Hey Daniweb, I have recently started working with threads in the c++11 library. I started with a simple dispatch mechanism where I have a queue and that would get passed to the threads and the threads would take turns emptying the queue. Since each thread needs to share the queue …

Member Avatar for NathanOliver
0
308
Member Avatar for spritzer

how to code a program using c++ so that a customer can rent upto 3 books and how to ban that user if not returned the books. Please help.

Member Avatar for richieking
0
134
Member Avatar for jonathan710

So for my homework i needa write a code that requires me to look up on a T key and adding stuff to T values. Could someone help me plz? (ie can i set both the key and value to template type) p.s. sorry not being able to expain the …

Member Avatar for richieking
0
330
Member Avatar for gonzalez50
Member Avatar for f4fjks

Hey All! kindly please tell me how to get user input right after the outtextxy function in graphics mode. Compiler : Turbo C , Win XP here is my program: [CODE]#include<stdio.h> #include<conio.h> #include<graphics.h> void main() { int gd=detect,gm,s; initgraph(&gd,&gm,"c:\\tc\\bgi"); cleardevice(); outtextxy(100,120,"enter number here : "); scanf("%d",&s); getch(); }[/CODE] now here …

Member Avatar for Cihan_1
0
671
Member Avatar for MOKSHo

write a template for a function called total . the function should keep a running total of values entered by the user , then return the total . the argument sent into the function should be the number of values the function is to read . Test the template in …

0
150
Member Avatar for ShawnCplus

This is just a little something for those of you used to using the Eclipse IDE, it's syntax highlighting almost identical to Eclipse save a bit of enhancement. Eclipse doesn't highlight ints, octal and hex individually but DevC++ can, there are a few other things in there that promote very …

Member Avatar for Tech_1
3
393
Member Avatar for jonathan710

So I was asked to solve this question...however when i compile it, it doesn't work...could somebody tell me what's wrong and how to solve it (im guessing it's something to do with overloading since my lecturer was talking abt it just before this was given)? thanks a lot! #include <iostream> …

Member Avatar for DeanMSands3
0
266
Member Avatar for andrew mendonca

For the maze program, with '*' indicating a wall, ' ' indicating a corridor, and '#' indicating a solution path, where I have to use a recursive backtracking algorithm, I am still having trouble print the maze solution. Here is the unsolved maze: 8 12 ********** * * * * …

Member Avatar for kal_crazy
0
311
Member Avatar for johans22

i need to be able to delete registry key in windows 7 and win XP using c/c++. Is there any example code that does it? I modified a VB code that I wrote for win2000 and it partially works on both OSs with error messages. I need to start fresh.

0
46
Member Avatar for PratyushTheGreat

We get the co-ordinates of a projectile at t1, (a,b) at t2 (c,d) at t3, (e,f) and so on as required. Write a program in C++ to calculate equation of trajectory of projectile..

Member Avatar for Rahul47
0
131
Member Avatar for moon.fall.58

I am having difficulties with the binarysearch function. I managed to get sorting and binary search done. However when I search a name it has to be the entire name for example Allison, Jeff. However, I want to know how to search just the first or last name of the …

Member Avatar for Ancient Dragon
0
188
Member Avatar for Echo89

This is a function that generates a string of random characters to the length that you specify.

Member Avatar for 5n0wn1nja
0
7K
Member Avatar for Elias_2

A hospital desires to computerize its daily parking activity. The parking opens its doors from 8 AM till 8 PM. Therefore; they bought a device to issue cards, at the entrance gate upon the visitor request, showing the arrival time. Upon leaving the parking the same card is inserted again …

Member Avatar for freeviewman
0
125
Member Avatar for ameen994

[Click Here](https://www.dropbox.com/s/3qd8ws32zf7roqm/Code%20Skeleton.cpp) Code Skeleton. [Click Here](https://www.dropbox.com/s/iw1me7wozongm7l/HW1%20Description.pdf) HW Description.

Member Avatar for kal_crazy
-1
153
Member Avatar for prettyknitty

Hello, I was wondering what a second pair of eyes (or several) might have for opinions on this code? This program is supposed to store a user generated array, and functions which tell the highest, lowest, etc. Mainly, I need help with the "set cell" part, which is supposed to …

Member Avatar for NathanOliver
0
216
Member Avatar for HenryR7

#include <iostream> #include <iomanip> #include <string> #include <cstddef> #include <cstring> #include <fstream> #include "IntStack.h" using namespace std; int main() { char c; ifstream inFile; string filename; cout << "Enter the filename " << endl; cin >> filename; inFile.open(filename); IntStack stack(50); if (!inFile) //file could not be opened { cout << …

Member Avatar for HenryR7
0
166

The End.