Forum: C++ Dec 27th, 2006 |
| Replies: 3 Views: 3,141 And because this is C++, #defines should be made const. And he's using C style strings, not std::strings. |
Forum: C++ Dec 15th, 2006 |
| Replies: 3 Views: 3,141 #include <iostream.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
O-o-outdated. It's:
#include <iostream>
#include <cstdio>
#include <cstdarg>
#include <cstdlib> |
Forum: C++ Dec 10th, 2006 |
| Replies: 7 Views: 2,947 I'm sure there is an example either in the code snippets section or on Wikipedia. |
Forum: C++ Dec 7th, 2006 |
| Replies: 9 Views: 1,352 1) Use [code] tags.
2) void main (){ Nope, its int main(){
3) studentResultsStream.open(a:studentResults.txt"...Missing opening quote. |
Forum: C++ Dec 7th, 2006 |
| Replies: 9 Views: 1,352 Please show some effort. We will not do your homework for you. Post your attempt for us to correct. |
Forum: C++ Dec 6th, 2006 |
| Replies: 7 Views: 4,224 You created a new thread with the same question. Look there. |
Forum: C++ Dec 6th, 2006 |
| Replies: 7 Views: 4,224 1) number = get_number(); // subroutine will ask user for a numberNot if it's not defined it won't ;)
2) cin >> get_number
a. Where is get_number defined?
b. Missing semi-colon.
3) cout <<... |
Forum: C++ Nov 29th, 2006 |
| Replies: 0 Views: 5,253 This is a simple rock paper scissors game using random numbers. |
Forum: C++ Nov 25th, 2006 |
| Replies: 4 Views: 5,639 |
Forum: C++ Nov 24th, 2006 |
| Replies: 2 Views: 5,612 You may want to take out the non-standard functions and headers (getch(), etc). |
Forum: C++ Nov 22nd, 2006 |
| Replies: 7 Views: 1,283 The problem is he divides radius by n before n is initialized or inputed. |
Forum: C++ Nov 21st, 2006 |
| Replies: 7 Views: 1,283 First write out a timeline of how to do it on paper. Then take that timeline and translate it into code. (hint: this double width = radius / n; is in the wrong place). |
Forum: C++ Nov 21st, 2006 |
| Replies: 2 Views: 2,092 There are some outdated elements (goto), non-portable ones (system("PAUSE"), and a complete lack of indentation. |
Forum: C++ Nov 21st, 2006 |
| Replies: 5 Views: 3,886 6) Take out the .h's:
include <iostream>
//etc... |
Forum: C++ Nov 21st, 2006 |
| Replies: 7 Views: 1,283 Also, your main function needs a closing brace:
int main()
{
int n;
double radius = 2;
double width = radius / n;
cout << "Enter the number of rectangles> ";
cin >> n;... |
Forum: C++ Nov 20th, 2006 |
| Replies: 2 Views: 4,804 Main should have a type int main (void) |
Forum: C++ Nov 20th, 2006 |
| Replies: 5 Views: 3,886 1)Main should have a type: int main (void)
2) O-o-out dated: goto begin;
3) What's with the indentation?
4) Seed rand only once, at the start of the app.
5) Could you have made this any less... |
Forum: C++ Nov 20th, 2006 |
| Replies: 1 Views: 1,520 This void main()should be int main(void). Try to find alternatives to using clrscr, etc, as they are non-portable. |
Forum: C++ Nov 20th, 2006 |
| Replies: 4 Views: 3,850 Is this C++ code? It looks like C code. |
Forum: C++ Nov 20th, 2006 |
| Replies: 4 Views: 1,560 Try this (http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1048382857&id=1043284392)page. |
Forum: C++ Nov 20th, 2006 |
| Replies: 1 Views: 1,334 1) Please indent your code.
2) What are the line numbers of the errors?
3)void main () should be int main (void) |
Forum: C++ Nov 20th, 2006 |
| Replies: 6 Views: 4,532 |
Forum: C++ Nov 19th, 2006 |
| Replies: 6 Views: 4,532 void main()Should be int main (void) |
Forum: C++ Nov 18th, 2006 |
| Replies: 6 Views: 4,532 How about you don't double post code snippets? |
Forum: C++ Nov 18th, 2006 |
| Replies: 11 Views: 4,093 Also, using namepace std is not always better than what the OP did. His way is fine. |
Forum: C++ Nov 15th, 2006 |
| Replies: 6 Views: 5,633 Also, please use [code] tags. |
Forum: C++ Nov 15th, 2006 |
| Replies: 8 Views: 1,580 |
Forum: C++ Nov 14th, 2006 |
| Replies: 6 Views: 1,528 void main()Should beint main() |
Forum: C++ Nov 13th, 2006 |
| Replies: 2 Views: 4,829 It will compile and work, at least for me. [n] and [n-1] in that section produce the same output for me. I'm using wxDev-C++.
EDIT: In fact, this causes it to output n (1) twice, which is... |
Forum: C++ Nov 12th, 2006 |
| Replies: 6 Views: 1,770 Please don't post the same thank you three times :rolleyes: |
Forum: C++ Nov 12th, 2006 |
| Replies: 6 Views: 1,770 Did it work? I would assume it did, all you had to do was enter a number to cin :lol: |
Forum: C++ Nov 12th, 2006 |
| Replies: 6 Views: 1,770 Try entering a number and pressing enter. |
Forum: C++ Nov 11th, 2006 |
| Replies: 7 Views: 1,497 Have you tried searching google for binary search recursive? That should turn up many results, as Ancient Dragon said. For starters, try looking here... |
Forum: C++ Nov 10th, 2006 |
| Replies: 4 Views: 1,194 I can read English, not gibberish. If you want help, you must actually post in a reasonable fashion. Also, USE CODE TAGS! Can you not read the backround of the post screen? |
Forum: C++ Nov 10th, 2006 |
| Replies: 14 Views: 3,950 And as a final reason, it's no longer being updated. While Dev-C++ IDE isn't either, you can download MinGW patches for it. |
Forum: C++ Nov 10th, 2006 |
| Replies: 2 Views: 4,829 This is a function that will find the factors of a given number for you.
EDIT: Better algorithm using vectors (thanks all at cprog :) ) |
Forum: C++ Nov 10th, 2006 |
| Replies: 14 Views: 3,950 Why use Turbo C? Try downloading Dev-C++, Code::Blocks, or if you're into the command line, gcc. |