Forum: C++ Nov 12th, 2008 |
| Replies: 12 Views: 1,459 What are those errors that you are getting? And what is it that you are trying to move to main, cout? |
Forum: C++ Nov 12th, 2008 |
| Replies: 7 Views: 429 What is it that you are having problem with? Are you getting errors when you compile? Does it compile but doesn't display the correct values?? |
Forum: C++ Nov 12th, 2008 |
| Replies: 12 Views: 1,459 |
Forum: Java Nov 7th, 2008 |
| Replies: 1 Views: 293 Hey all, I use Windows XP and atm, I need to increase the memory allocated from default 64M(i think?) to 500M.
So I'm in the directory where the jar file is (I'm using JFLAP if anybody is familiar... |
Forum: C++ Nov 5th, 2008 |
| Replies: 2 Views: 783 There's nothing about validating in your book because it's not standard, it's something that you make it yourself.
mm that's all i can **** to write down atm..... let me know if you need more... |
Forum: C++ Nov 5th, 2008 |
| Replies: 5 Views: 382 Do you get any errors? Because syntax wise, it looks okay to me.. |
Forum: C++ Nov 5th, 2008 |
| Replies: 3 Views: 630 You see, you declared num. Now num points to a 4byte block which contains a garbage information. So when you are calling mysterlen, you are giving whatever happened to be stored in that block of... |
Forum: C++ Nov 4th, 2008 |
| Replies: 6 Views: 3,014 Why would you need to use a char array? using int array should be fine.
reverse (num)
array[count] = num
count ++
get a new num
reverse (num)
print out array[count]
count-- |
Forum: C++ Nov 4th, 2008 |
| Replies: 5 Views: 393 Someone correct me if I'm wrong please.
As of array, when you first declare array, you are allocating a block of memory and what you get is a pointer( address of a memory) that indicates where... |
Forum: C++ Nov 3rd, 2008 |
| Replies: 8 Views: 855 If you are having problem with rand() go google 'rand cpp reference'. It has a nice example as to how to use it.
And like the above poster has mentioned,
>>while (x % answer != 0) answer++;
... |
Forum: C++ Nov 3rd, 2008 |
| Replies: 4 Views: 370 I think it is because C is just more flexible when it comes to handling memory.. hence giving your more control over it.
[edit] Another thing I can think of is that char is one byte while int is... |
Forum: C++ Nov 3rd, 2008 |
| Replies: 4 Views: 370 Didn't you post the same topic before? The answer is like two pages behind. h is char but g is int. they are not of the same type. |
Forum: C++ Nov 3rd, 2008 |
| Replies: 6 Views: 674 No I don't think that's what her teacher meant. By doing what you did there, you are "hardcoding" this. That is not a good practice. Suppose he wanted to change the char array from "This is a test"... |
Forum: C++ Nov 3rd, 2008 |
| Replies: 9 Views: 513 If you are really determined to learn it on your own, start with little projects. In fact, if you go to one of the stickied threads above, there are a bunch of problems for beginners that you can try... |
Forum: C++ Nov 3rd, 2008 |
| Replies: 10 Views: 843 Well, I'm a noob myself. Just read the code. Good amount of standard built in functions are very readable. For instance, when you see letters.begin() or letters.end() you know what that means. I've... |
Forum: C++ Nov 3rd, 2008 |
| Replies: 10 Views: 843 Well, the code above isn't correct. That takes all alphabets, regardless whether it is a capital letter or a small letter, push it into a vector, sort and prints them out. (vector is like array but... |
Forum: Geeks' Lounge Nov 3rd, 2008 |
| Replies: 1,549 Views: 200,818 Mark Twain
There are three kinds of lies: lies, damn lies and statistics. |
Forum: Community Introductions Nov 3rd, 2008 |
| Replies: 2 Views: 320 Sorry, I lied!!!
I usually don't post in "hello i'm a noob at this site" but i just wanted to make a topic that (wrongfully) claimed that i'm not a geek.
I'm from US. Btw, Freud is a fraud!!... |
Forum: Geeks' Lounge Nov 3rd, 2008 |
| Replies: 9 Views: 1,195 it looks good... but it lacks a fridge full of food :/ |
Forum: C++ Nov 3rd, 2008 |
| Replies: 14 Views: 829 Do check the syntax. When the compiler throws an error, DO READ THE ERROR. Error really tells you what exactly is wrong with your code.
if ((wheelNumber = 0) && (bet = 0))
{
cout<< "You win!... |
Forum: C++ Nov 2nd, 2008 |
| Replies: 2 Views: 271 /high fives mrboolf
sorry for non constructive post but people aren't here to do your hw. They are here to help and guide and point out flaws. |
Forum: C++ Nov 2nd, 2008 |
| Replies: 3 Views: 430 When you are passing row and col to get Data, you are derefenrencing it. But they are of type int. And what does " >> " operator do? I've never seen it used out side of cin >> .
[edit] er nvm i... |
Forum: C++ Nov 2nd, 2008 |
| Replies: 14 Views: 829 Well, your syntax errors can be easily figured out from the errors. So do read the errors carefully, go back to your code, think about it a bit more, google the error message and if you still can't... |
Forum: C++ Nov 2nd, 2008 |
| Replies: 10 Views: 843 Because when you are comparing
if ( text[i]>=65 && text[i]<=90 )
{
lol[j]=text[i];
j++;
}
what you are doing is you are comparing the content of the array which is not an int.... |
Forum: C++ Nov 2nd, 2008 |
| Replies: 6 Views: 762 Go look up reference manual or something. http://www.cplusplus.com/reference/clibrary/cstdlib/srand.html
Can you actually compile the code? Because I see that underneath
srand((unsigned int)... |
Forum: C++ Nov 2nd, 2008 |
| Replies: 3 Views: 345 I'd have to say the contents. To check if they refer to same memory locations, you will have to dereference when you compare. |
Forum: C++ Nov 2nd, 2008 |
| Replies: 6 Views: 762 Well, upon searching google....
http://www.cprogramming.com/tutorial/random.html
I think it shows good examples of using random number generator using seed and stuffs. |
Forum: C++ Nov 2nd, 2008 |
| Replies: 14 Views: 829 Well, I'm a noob myself so not really sure if I'm helping you or not but I guess I'll give it a shot.
First of all, you did declare typeOfBet and allocated memory for it but what's inside of that... |
Forum: C++ Nov 2nd, 2008 |
| Replies: 10 Views: 843 Er, I'm not really sure what you are trying to do with your do loop.
But here's how I would go about it. If I had time, I'd write the actual code but I'm just procrastinating for another... |
Forum: C++ Nov 2nd, 2008 |
| Replies: 3 Views: 1,018 I'm using gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
Thanks for the tip, I did try casting double but I guess I typecasted double(2/num) instead of double(2)/num. Thanks... |
Forum: C++ Nov 1st, 2008 |
| Replies: 3 Views: 1,018 For some weird odd reason, sqrt(2/num) does not work.
cout << " sqrt(2): " << sqrt(2) << endl;
cout << " sqrt(num): " << sqrt(num) << endl;
cout << " sqrt(2)/sqrt(num): " <<... |
Forum: C++ Nov 1st, 2008 |
| Replies: 4 Views: 333 Well, since the description of the readSeq funcion doesn't actually describe what it is returning, maybe it should be void readSeq, rather than int. And as of passing parameters, why do you need to... |
Forum: C++ Oct 31st, 2008 |
| Replies: 5 Views: 2,978 Actually, I answered my own question. Found out that I was using gcc in the makefile rather than g++.g++ includes gcc and more. |
Forum: C++ Oct 31st, 2008 |
| Replies: 5 Views: 2,978 Thanks, Prabakar.
On a somewhat related note, I also have linking problems. Such as
test.cpp:(.text+0x206): undefined reference to `std::cout'
test.cpp:(.text+0x20b): undefined reference to... |
Forum: C++ Oct 31st, 2008 |
| Replies: 24 Views: 61,667 As of top coder, there is a "practice" room where there are thousands and thousands or maybe just hundreds of problems you can solve. and they are also divided into sections for beginners,... |
Forum: C++ Oct 31st, 2008 |
| Replies: 5 Views: 2,978 Hi, I'm doing a very very simple coding, However the compiler apparently does not like my usage of cin and gives me an error: no match for 'operator<<' or 'operator>>' depending on cout or cin.
... |