Anyone have an idea on how to start on this function?
Type: Posts; User: cisokay
Anyone have an idea on how to start on this function?
I'm trying to add the countMax() function but I'm not sure how to properly check for prefixes.
int countMax(char x[])
{
TrieNode *current = root;
int i = 0;
if(Member(char...
I have this trie class that has a few methods I'm trying to add addtionally two more new methods. A countMax() to count the number of words (x) such that no prefix with at least one letter of (x) is...
Thank you very much, after many hours reading and debugging I finally got the system working. The problem know is that I have variables count and maxcount for each of the classes, I have to create a...
I have question about constructors,
If i have
Class A {
private:
int x;
int y;
I'm still confused about the Person constructor, when you create an instance of another type of person you have to handle it in the person constructor?
Person::Person(string name, int age, int...
Yea I thought it be best to use this scope to make it clear. I'm just having trouble setting up the constructors. What should be set to what and how it should be set. I've done OOP in JAVA before and...
I think I should scale the program down till I fully understand what is going on in each of the instances of person. I have completed most of the coding and size it down to 1 base/abstract class and...
In the destructor should it be the following:
Chancellor::Chancellor(string name, int age, int years_in_college, SEX sex,
string department, LEVEL level, bool cameFromUCSB)
...
We haven't gone into advanced topics such as wrappers and stl libs. Maybe the test program we are given will shed some light.
#include "school.h"
int main()
{
Initialize(10); // No...
Here is what I have so far as my sources, sorry if its alittle long.
school.h
#include <iostream>
using namespace std;
typedef enum {male, female} SEX;
typedef enum {assistant,...
If I have to create a .h and .cpp file and I have to work with abstract classes and classes that inherit from the base class. How should I break down the header and cpp file? I'm not sure which goes...
No, the image isn't getting changed at all. Yes our professo told us about the padding. He said with our bmp that he gave us, we won't have to compensate for that issue. All information from header...
I'm given a bmp and I'm trying to create a new image and output that to bmp file. I'm not sure if I'm doing it correctly.
Bmp consist of three 3structs:
Header, InfoHeader, Data
I'm able to...
Thank you all for your great comments and hints. I actually solved this yesterday using the nice bitset class. Though, these other methods are great as well. Thank you all.
Thanks, I think I get it now. One question, I get makefile:4: *** missing separator. Stop. error. I'm copying directly from your post.
It isn't liking the
.PHONY clean compile
So if prog.o is older than prog.c then it will compile the source with this makefile, else it will skip it ?
#Makefile
#############
default: clean compile
compile: prog.cpp
Sometimes when I run my makefile that consist of the following
[code]
default:
g++ -o prog1 prog1.cpp
clean:
rm -rf *.o
rm -rf core*
[code]
Thanks that works great, your refraction shortens the lines of code. Now I got the conversion to work and able to work with it in binary. I have to convert it back. I made a function that used...
I'm given a string that is of binary 1's and 0's and I'm trying to make a function that is able to set the bits to the location that is specified.
If 35 represented in 100011
If I wanted to set...
I have a program that can take in 3 arguments. They can be called in almost any order and they can be invoked more than once. I'm trying to use a switch statment to determin which case is called, but...
Does anyone have a good example/tutorial of how to handle flags using getopts or another structure with values to be read in right after the flags. I'm using a generic switch checking for the '-'...
Thanks, I actually figured out how to loop through a certain amount of bases to print out. Just threw another while loop outside of the input check and as long as the val < valtostopat. Thanks for...
How would I modify it to make it print bases 0 - 30?
I can see that:
char table[] = "0123456789ABCDEFGHIJKLMNOPQRST";
Can be modified for the switch statment, but I'm unsure how the...
Sorry about that. This should compile now. Though I still get the floating core dumped process. Not sure if it is because base is init to 0. Thank you for your time.
#include <iostream>...