Forum: C++ 2 Days Ago |
| Replies: 10 Views: 302 Here's what i have:
#include <iostream>
#include <fstream>
#include <iomanip>
#include "account.h"
#include "Lentext.h"
#include "Deltext.h" |
Forum: C++ 2 Days Ago |
| Replies: 10 Views: 302 its still won't work. I don't understand why. |
Forum: C++ 2 Days Ago |
| Replies: 10 Views: 302 Here are my teachers directions
FILE PROCESSING - PROGRAMMING PROJECT 2
DUE: 10/28/09
This programming project is to modify the first project to be one that uses two of the buffers and the... |
Forum: C++ 2 Days Ago |
| Replies: 10 Views: 302 i don't think that is the intent of packing a buffer. IT is supposed to have a record which contains of fields and store it into a buffer everytime the all account objects assigned. The pack and send... |
Forum: C++ 2 Days Ago |
| Replies: 10 Views: 302 but the code in my book shows that i should pack and my teacher said I should Pack the object, then write it to the file, that way the person class and buffer class don't know anything about each... |
Forum: C++ 2 Days Ago |
| Replies: 10 Views: 302 ahhhh it won't pack.. it returns 0 which means information isn't packed. This code in my book doesn't work.
main
#include <iostream>
#include <fstream>
#include <iomanip>
#include "account.h"... |
Forum: C++ 4 Days Ago |
| Replies: 10 Views: 302 Here's what i have. Not sure what it is doing exactly.
You pack a account object and then you write it to the buffer right? So shouldn't it print after i write it?
Main
#include <iostream>... |
Forum: C++ 6 Days Ago |
| Replies: 6 Views: 245 |
Forum: C++ 6 Days Ago |
| Replies: 6 Views: 245 |
Forum: C++ 6 Days Ago |
| Replies: 6 Views: 245 basically i have 4 files 2 contain the following data . Trying to find out data which is common and not common in both files and write it out to files common and not common. It almost works except... |
Forum: Computer Science 8 Days Ago |
| Replies: 1 Views: 281 Please help really confused. |
Forum: C++ 8 Days Ago |
| Replies: 2 Views: 179 i got it to work so its all good. |
Forum: Computer Science 8 Days Ago |
| Replies: 1 Views: 281 a multilevel index using a B-tree is to be made for a file with 600,000 records. A block contains 1500 bytes, a key is 10 bytes, a pointer is 5 bytes and a data record is 100 bytes.
a)What is the... |
Forum: C++ 8 Days Ago |
| Replies: 2 Views: 179 gives me error on 3rd coded line in search().
#ifndef MY_HT_CHAIN_H
#define MY_HT_CHAIN_H
#include <iostream>
#include <vector>
#include <list>
using namespace std; |
Forum: C++ 9 Days Ago |
| Replies: 8 Views: 209 nvm i found my mistake it wasn't even in here. It was when i constructor my vector apparently the vector(# of values you wish to assign, what you wish to assign) not other way round. |
Forum: C++ 9 Days Ago |
| Replies: 8 Views: 209 my insert function won't work. :( I got it to work before.
void my_ht_chain::insert(int key)
{
//go through loop to check if hashing function matches vector index
for(int i=0; i<tablesize;... |
Forum: C++ 9 Days Ago |
| Replies: 8 Views: 209 nvm i finally got it work. Thanks thought. |
Forum: C++ 9 Days Ago |
| Replies: 8 Views: 209 kind of need help with syntax again.
in my insert method, i am supposed to expand an vector with a list. Not sure what to do within if statement.
Rather how I say at this index in my vector... |
Forum: C++ 9 Days Ago |
| Replies: 8 Views: 209 thanks! it makes a lot more sense its just like when you declare an array. we kind of have to for this hash table assignment. Have to create using seperate chaining method. Will ask for help again... |
Forum: C++ 9 Days Ago |
| Replies: 8 Views: 209 so for instance say i did dataTable->at(key) would i be referring to the list or vector? or both? |
Forum: C++ 9 Days Ago |
| Replies: 8 Views: 209 Is my understanding of a vector list correct. vector<list<int>>.
The vector holds a list of data type int?
class my_ht_chain
{
public:
//constructor which creates a table of a certain... |
Forum: C++ 9 Days Ago |
| Replies: 7 Views: 200 actually it isn't too difficult to change my code. Thanks for help. I realized i was getting many errors because two variable are named the same thing. |
Forum: C++ 9 Days Ago |
| Replies: 7 Views: 200 but my teacher wants a constructor and a destructor. So i guess i have to use pointers. |
Forum: C++ 9 Days Ago |
| Replies: 7 Views: 200 how do i do this without changing it to a pointer? then i need to change all the remainder of my code and would have to use a iterator. |
Forum: C++ 9 Days Ago |
| Replies: 7 Views: 200 thanks i completely forgot about that. |
Forum: C++ 9 Days Ago |
| Replies: 7 Views: 200 Do I need a copy constructor?
#ifndef MY_MIN_PQ_H
#define MY_MIN_PQ_H
#include <iostream>
#include <vector>
using namespace std;
class my_min_pq |
Forum: C++ 9 Days Ago |
| Replies: 0 Views: 143 we are supposed to implement using STL vector and base it on priority and have have a data value
So every time i enqueue i insert an in item into the end of the vector and if no space i modify. So... |
Forum: C++ 12 Days Ago |
| Replies: 7 Views: 227 you could try using the &symbol before the variable but that might just put in memory location of those arrays. |
Forum: C++ 13 Days Ago |
| Replies: 5 Views: 222 you pass in k to your function i believe. |
Forum: C++ 13 Days Ago |
| Replies: 2 Views: 230 hmmm... for the calendar it depends on whether its a leap year or not. So every time 4 years pass the days that it happens the days change. Don't think that their is a pattern. Write it out for the... |
Forum: C 13 Days Ago |
| Replies: 4 Views: 306 why are you using a structure? Use object oriented programming with classes lot easier and use recursion. May take more time to come up with but it is easier to understand |
Forum: C++ 13 Days Ago |
| Replies: 4 Views: 217 i got it works thanks for help! |
Forum: C++ 14 Days Ago |
| Replies: 4 Views: 217 i mean when the left and right tree is balanced. So returns true. |
Forum: C++ 14 Days Ago |
| Replies: 1 Views: 207 |
Forum: C++ 14 Days Ago |
| Replies: 1 Views: 207 i get a stack error
template <class KT, class DT>
void my_bst<KT,DT>::show_bst_structure() const
{
my_bst_node<KT,DT>* b=root;
show_bst_structure(b,0);
} |
Forum: C++ 14 Days Ago |
| Replies: 3 Views: 246 conclusion don't think its possible with just a recursive function since the number of links keep on increasing as you go down the tree :(. Wasted 24 hours on this. |
Forum: C++ 14 Days Ago |
| Replies: 3 Views: 246 i got those functions to work. I need depth-first approach. Is their any way to do this without a stack or queue? |
Forum: C++ 14 Days Ago |
| Replies: 3 Views: 246 Here's what I have so far
template <class KT, class DT>
void my_bst<KT,DT>::show_bst_structure(my_bst_node<KT,DT>*& p) const
{
my_bst_node<KT,DT>* le=NULL;
my_bst_node<KT,DT>* ri=NULL;... |
Forum: C++ 14 Days Ago |
| Replies: 4 Views: 217 i believe that it checks every nodes height and makes sure that the left -right is 1 or 0 or -1. It is supposed to return tree if tree is balanced which means that left-right is 0 or 1 or -1 at every... |
Forum: C++ 14 Days Ago |
| Replies: 5 Views: 222 you probably need a factorial function to find 1*2...*k.
it should probably be recursive |