No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
i have a text file "test.txt" with "This is a secret file" in it. I want to read in the whole sentence in with white spaces and manipulate each character. How can i do this? My current method leaves out white spaces. [CODE]const int SIZE = 17; char string2[SIZE]; ifstream … |
|
something is wrong with my dequeue function. When i try to output the value that's about to get deleted i get garbage on the console window. the enqueue function works fine. [CODE]class Queue { private: int value; Queue *next; public: void dequeue(); void enqueue (int num); }; Queue *head=NULL; void … |
|
every time i run the program it prints out 0. I think something is wrong with my display function but i cant see the problem. [CODE]#include <iostream> using namespace std; #define STACKSIZE 10 class stack { private: int arr[STACKSIZE+1]; int tos; public: stack(); void push(int x); int pop(); bool is_empty(); … |
|
so i have a char array that can hold up to 1000 items.. but it might not be filled up completely. How can i prevent the program from printing garbage on the screen after printing the real values from the array. btw i am reading from a file, sorting by … |
|
the program wont compile because it found and error with ReadFromFile class method in the main.cpp file. Any help would be appreciated. class inventory deceleration in "Inventory.h" file [CODE]#ifndef INVENTORYDEF #define INVENTORYDEF #include <iostream> #include <fstream> int const MAXNAME=30; int const SIZE=2; class Inventory { private: int quantity[SIZE]; float unitcost[SIZE]; … |