Ahh got it. Thanks.
Type: Posts; User: Josh Norton
Ahh got it. Thanks.
What exactly is that and why is it good style? I always just delete it when the compiler adds it in heh.
:D
hmm. Maybe incorrect but, it works fine as it's written in my compiler.
#include <iostream>
#include <conio.h>
using namespace std;
struct MyBools
I dont know a lot about structs but, that's the first time I have seen a colon used in them. Is that an error or? If your trying to assign an initial value to each of them I don't think your...
I have'nt compiled the code yet but just off hand I see that the output operator (<<) is backwards in the entire cout statement that outputs the structure.
Working now.
Not sure if the site is down or the url is bad but the link is not working.
I think you missed the question.
ok. When I had 'i' declared size_t and the loop got below zero it was seg faulting since i would roll over(I guess) to the max value for an unsigned int( 4294967295 when I just tried it). I'm not...
I'll just post it all... It's not an error. Just a warning. It reads:
lab7.cpp(93) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
The loop...
I know comparing a syze_t type to an int in my for loop caused a seg fault. I guess since size_t was unsigned and being compared to a negative value(or so I assumed)? I changed "i" to an int and it...
Well. Corrected it in dev C++ anyways. VC7 still skips right through the getline call. =/
Bah nevermind. Of course I find the answer as soon as I post the problem.
cin.ignore()
seemed to correct it.
~Joshua Norton
I was just having a problem using getline myself and I found this thread in the search. Just wanted to note that
char name[15];
cin.getline ( name, '\n' );
Does not work. I think...
Certainly fixed all the errors though. I will search for it and try and find info. Thanks for the help Sebastiani.
~Joshua Norton
I also get
"signed unsigned mismatch" when comparing the size to an int in a for loop.
Not sure what a size_t is. Im guessing it's a type created in the string header or something? Is it just...
Hey,
I am writing a palindrome app for a class. I'm having a problem though using size() or length() for the string lengths. I keep getting a typecast error but I am almost sure I am...
The window disappears because once the program is done running it has no reason to remain open. You can use a function to hold the window open for you like
system("PAUSE"); on a windows box. You...
Thanks. This avoided the error. I added pennies++ to your addition to account for the fact that .0099 does represent the last penny.
Thanks again!
Ok so I'm trying to write a console app that will take from the user the amount of money due and the amount of money tendered and make change. One of the requirments was to use reference parameters...
Well it was almost correct.
#include <iostream>
#include <stdlib.h>
using namespace std;
int main(void) {
Yeah I see what your saying. I had both uses in my app and had both set backwards heh.
Nm. Another retarded question lol. For some reason I had confused the middle argument of the for loop as the "while this condition is false" when in reality it's saying "while this condition is...
err why would the second loop be
for (int i = 0; i < 8; i++)
when the valid array elements are 0 - 7?
Thanks for the fast response. I knew I was staring too hard and overlooking something silly :D. Thanks again.