49,761 Topics
| |
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 … | |
// 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 … | |
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 | |
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 … | |
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 … | |
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 … | |
heyyy every one .. can u guys write a c++ program to draw lozenge?? i tried to draw square triangle etc.. | |
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 … | |
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++**..? … | |
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++; … | |
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 … | |
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 … | |
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 | |
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 … | |
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. | |
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 … | |
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 … | |
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 … | |
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 … | |
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> … | |
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 ********** * * * * … | |
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. | |
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.. | |
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 … | |
This is a function that generates a string of random characters to the length that you specify. | |
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 … | |
[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. | |
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 … | |
#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 << … |
The End.