YAY:)!!! Thanks so much dwks, and everyone else who helped me! My program is finally funtioning!!!:):):):):):):):):)
Type: Posts; User: jmajeremy
YAY:)!!! Thanks so much dwks, and everyone else who helped me! My program is finally funtioning!!!:):):):):):):):):)
Do you tink it might have something to do with the for statement in randomize? I meed to get a new random number each time. I feel like I'm getting really close!
i feel like i'm getting so close.
here's my source code:
#include <iostream>
#include <cstdlib>
#include <time.h>
#include <cctype>
#include <windows.h>
#include <string.h>
ok, wen i do that, it returns the email as it was originally. this tells me that the problem lies in randomizing the characters. I will play around with it a bit.
#include <iostream>
#include...
ok, i've traced the problem to the value that randomize(string) returns. Just before it returns the value I added a cout, and it's not randomized, but thats another problem that I can deal with...
I think the problem might have something to do with passing the arguments to randomize(string), or what it returns. It could also be my use of fstream, any suggestions?
I changed around by code again to try and avoid what I think was happening (I was calling the function getAddy() in certain places unintentionally causing it to appear to just loop over and over...
ok, here's the updated code...
#include <iostream>
#include <cstdlib>
#include <time.h>
#include <cctype>
#include <windows.h>
#include <string.h>
#include <fstream>
Here's the updated code...
#include <iostream>
#include <cstdlib>
#include <time.h>
#include <cctype>
#include <windows.h>
#include <string.h>
#include <fstream>
Should it be wriiten as...
cin >> var;
cin.ignore();
// or
cin.irgnore() >> var;
?
its still doing the same thing
if i put getline(), cin.ignore(), or if i jst change it to:
for (int i=0; i <= 10; i++) {
randomize();
saveAddy(); }
, I get the same result.
u could try
int op;
switch ( op ) {
case 0:
break;
case 1:
continue; }
PS: I haven't tried that, so it's just a vague idea of what I might attempt to do if I was in your situation.
what i would do to get the first number is the following:
char fstNum[28];
for (int i = 0; i < 20; i++) {
cin >> fstNum[i];
if (fstNum[i] == '') { break; }
}
...or something...
no to be sarcastic, but what exactly are you hoping to achieve with this program? Looks like a bunch of over-complicated code for no apparent reason...
ok, string class seems to help, but I have now lead myself to another problem, of which I just can't seem to figure out. I know it's a little unorthodox, but, if you don't mind, I'm going to post my...
can i still refer to an individual character if i use the string class?
ok, i seem to have solved most of the problems by using some of your suggestions, and completely rearranging my function, but there seems to be a new problem. I decided to instead of returning a char...
here's part of my code that capitalizes the letters:
int xy = 1;
while (xy <= nl)
{
randNumGen();
if (randNumGen() == 1 || randNumGen() == 3 || randNumGen() == 5) {...
ok, thx, the toupper() thing speeds things up quite a bit, but now my problem is that my program doesn't seem to redo the getRandNum() function when I tell it to. This results in all the letter...
how can toupper() be an int if it returns a char?
just an afterthought: or do u mean
if (randNum == 1 || randNum == 2 || randNum == 3)?
so, Daved, does that meen I'd put
if (randNum == 1 == 2 == 3) or something?
and i hav no idea what u mean by
also, if i use the method marek said, how will i seperate retVal back into a char and...
I'm making a program where you input a word or phrase, and my program will automatically capatilize some of the letters in it. For example, if your entered
I am testing this program., my program...