Alright, I fixed things up a little bit by traversing to the middle instead of trying to keep tabs on the middle of the list at all times (a little less efficient, but at the same time, a lot...
Type: Posts; User: Saggio
Alright, I fixed things up a little bit by traversing to the middle instead of trying to keep tabs on the middle of the list at all times (a little less efficient, but at the same time, a lot...
Alright, so I'm creating a Queue class using pointers, but instead of only being able to insert things into the back, I want to also insert things in the front, and in the middle. the problem I'm...
Okay, I figured out some stuff:
Here's my new code if anyone is interested:
void Move(int i,int j)
{
if(Peg[i].top() <= Peg[j].top() /*&& (i*j != 2)*/)
{
That's because I wrote pseudo-code in word, I didn't include the return types.
Anyway, now that I got past that, I still can't get it to run properly. It goes through one move then crashes at...
Okay, so here's a modded tower of hanoi problem:
Instead of 3, we have 4 pegs, a source peg, a target peg, and 2 auxiliary pegs. Disks can
be moved from any stack to any other stack, with one...
Yes, it's a member of the Vector class.
The only reason why the function header doesn't look right is because it's currently defined in the Vector.h class...I haven't created the .cpp...
Okay, this error is rather annoying, as I can not progress with my program without resolving it.
It is an e-mail checker, and this part is extracting the domains (we previously did it with arrays)...
I have this constructor:
Reverser::Reverser( char* string )
{
int bufferSize = 0;
bufferSize = GetLength( string );
Size = bufferSize;
Buffer = new char[Size];
okay, after doing that and changing all .'s to ->'s, it now gives me a bad ptr error since it initializes it Buffer to NULL (0)...
How would I do that? I'm editing old code to use heap allocation...
Here's my main function, the problem lies almost in the first line where I delcare an instance of DynamicString on heap.
If you need more code, just let me know:
#include <fstream> // This...
Yeah, I usually turn it off, but I just installed the windows vista beta last week, looks like I forgot :p
Sorry about that, the problem is that it does not seem to be getting the input from the file correctly. It doesn't work with the code you posted, either.
EDIT: Oh wow, the whole problem was...
okay, here's my main...messy, I know, I've tried so much stuff to get it to run:
void main()
{
int i = 0;
ifstream fin("EmailTest.txt");
char s[300];
char* str = s;
...
okay, here's what I have:
here's the test string:
"[email protected]"
I have these calls: The first just copies the string and prints it, the second gets everything before the @ (not including...
Sorry, for all of the replies next to each other, but there is something wrong with the function it seems, but it's getting the correct length now.
here's the function as it stands now, with a...
IfYouSaySo, I understand what you're talking about with the vars...all Var names are specified by my professor, I have no control over that.
alright, I got it, adding a NULL char at the end of the loop fixed it.
Thanks! you jsut saved my butt :p
I think it is just used incorrectly.
after
Address.CopyTo(0, atPosition, LocalPart.UserName);
I have
nope, that's not the problem, I did a debug statement to print atPosition...it's right (8 for this particular string).
Also, just to make sure, I hardcoded 8 into the call of copyTo
there's...
Okay, so I have created a class MyString, and in it, I have a copyTo function. It has a starting position, an ending position, and the string it's supposed to be copied to.
Here's the function...
nevermind, I got it working.
Thanks, guys
It makes everything come up invalid...
okay, this is what I come up with, but I still can't seem to get it to work right...
I came up with the bounds by looking at an ascii value key...
for(int g = 0; g < length; g++)
{...
I forgot to add . and @ to the list of chars since it IS an e-mail addy. :p
umm, I haven't formulated a for loop yet, I'm just trying to write down some pseudo-code, and I can't get the logic to...
okay, what would the best way to check to make sure that all characters inputted by a user (which is stored as a char array) only consist of a-z, A-Z, and 0-9??
I was thinking a for loop for...