- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 3
- Posts with Upvotes
- 3
- Upvoting Members
- 3
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
- PC Specs
- Intel Pentium 4 WinXP SP2/ iMac G5 Mac OS 10.4.7
60 Posted Topics
Re: Main really should have a type: [INLINECODE]int main ( void )[/INLINECODE] | |
Re: How did you get hired? The point of work is, wait for it, TO WORK! Not to kill your "friend's" computer, and not to waste the companies resources. | |
This is a function that will find the factors of a given number for you. EDIT: Better algorithm using vectors (thanks all at cprog :) ) | |
Re: 1) This `void main()` Should be `int main( void )` 2)Try to eliminate the nonstandard functions. | |
Re: [code][COLOR=#008000]#include <iostream.h>[/COLOR] [COLOR=#008000]#include <stdio.h>[/COLOR] [COLOR=#008000]#include <stdarg.h>[/COLOR] [COLOR=#008000]#include <stdlib.h>[/COLOR][/code] O-o-outdated. It's:[COLOR=#008000] [/COLOR][code] [COLOR=#008000]#include <iostream>[/COLOR] [COLOR=#008000]#include <cstdio>[/COLOR] [COLOR=#008000]#include <cstdarg>[/COLOR] [COLOR=#008000]#include <cstdlib>[/COLOR] [/code] | |
This is a simple rock paper scissors game using random numbers. | |
Re: Use code tags! | |
Re: How about you don't double post code snippets? | |
Re: This [inlinecode][COLOR=#0000ff]void[/COLOR] main[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR][/inlinecode]should be [inlinecode]int main(void)[/inlinecode]. Try to find alternatives to using clrscr, etc, as they are non-portable. | |
Re: 1)Main should have a type: [INLINECODE]int main (void)[/INLINECODE] 2) O-o-out dated: [INLINECODE][COLOR=#0000ff]goto[/COLOR] begin;[/INLINECODE] 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 portable? | |
Re: Main should have a type [INLINECODE]int main (void)[/INLINECODE] | |
Re: There are some outdated elements (goto), non-portable ones (system("PAUSE"), and a complete lack of indentation. | |
Re: You may want to take out the non-standard functions and headers (getch(), etc). | |
Re: I also used Firefox for a while until IE7 came out. When I downloaded it, I was really impressed by the UI, the cleaness of it, and the functionality. I've now switched to IE, although I still will occasionaly use Firefox. | |
Re: Look at Tech Talk -> Hardware. ![]() | |
Re: I need to ask: why are you in a chinese university if you don't know chinese? | |
| |
Re: It all depends on your money. I like the more expensive one, but that's me. | |
Re: While I somewhat support the idea of a game development board (a.k.a fielding OpenGL/DirectX q's), a game forum would be distracting. | |
Re: Which is good, of course, in case some odd operating system decides that 74 is a good value to indicate success, and that 0 will be failure. | |
Re: If you like C or C++, look at the recommended books in that forum. Another compiler: Code::Blocks. | |
I'd like to have a blog here at DaniWeb, and I know how to dreate one. However, can I link my existing blog to my DaniWeb one? | |
Re: I like the idea. In my opinion the language problem is negligible, as most game coding is done in C++ (I said most, so don't kill me). Also, this topic could bring up many intelligent discussions, as game programming is a very advanced subject. | |
Re: I'm sure there is an example either in the code snippets section or on Wikipedia. | |
Re: Can't vote for more than one :sad: Add literature to my list, in addition to non-fiction. | |
Re: Yeah, particularly when they don't know how to spell 13373 ;) | |
Re: I like rabbits, particularly the evil Monty Python kind :cheesy: | |
Re: Sharky, do you just go around supporting all new forums in [B]bold[/B]? | |
Re: Closing (opening?) your firewall does not mean that random creepy hackers will immediatly jump in. While it is not a good idea to leave it open (closed?) for long, it is fine to quickly open/close (close/open?) it. | |
Re: [quote="ramgates"]c language where as the use of '^' is allowed in other simple languages.[/quote]Just one point: C is [I]not[/I] a simple language. Also, your poll makes no sense. | |
Re: Please show some effort. We will not do your homework for you. Post your attempt for us to correct. | |
Re: 1) [code]number = get_number(); // subroutine will ask user for a number[/code]Not if it's not defined it won't ;) 2) [code]cin >> get_number[/code] a. Where is get_number defined? b. Missing semi-colon. 3) [code]cout << "The charge account number you entered is valid and found in element "[/code]Missing semi-colon. 4)[code] while … | |
| |
Re: Thanks for the laugh Dani :) | |
Re: Quite a good idea. Unfortunately, it would be hard to get ALL compilers of ALL languages to comply. ![]() | |
As most of you know, the forum displays a pencil when you have posted in a thread. However, the code snippets section has no identification. I would like it if this feature was available, as I've commented in many snippets and it is hard to remember. | |
Re: What!? You'd need to have billions of dollars! 1. Send up satelite. 2. Set up network. Honestly, you can't just hijack satelites. :rolleyes: | |
Re: It's a hat trick in football: [IMG]http://www.solarnavigator.net/sport/sport_images/manchester_united_fc_team_group_photo_2005.jpg[/IMG] ![]() | |
Re: It would be nearly imposible to reconstruct C code as all compilers will compile it slightly different. Also, the same compiler might do it differently twice. | |
Re: Learn basic coding skills. Write out how you would do this on paper. How is it that humans figure out the largest number? Perhaps it has to do with [I]tests[/I]? | |
Re: Personaly I individualy declare the std members I'm using (std::cout, std::vector, etc) for clarity in what I'm doing. I like including only what I'm using, rather than just dumping all of std into my program, as this defeats the purpose of using namespaces. | |
Re: Compare what we have to those living in developing countries. We have it better than most. | |
Re: One question: is this happening to you? | |
Re: [IMG]http://www.royal-health.com/postcards/pcards/happy-birthday.gif[/IMG][URL="http://images.google.com/images?q=tbn:vFHGDCJ4WBgDPM:http://www.de-club.net/lpl/image/download/big/Happy-Birthday.jpg"][/URL] | |
| |
Re: Also, your main function needs a closing brace:[CODE] int main() { int n; double radius = 2; double width = radius / n; cout << "Enter the number of rectangles> "; cin >> n; [COLOR=red]}[/COLOR][/CODE] | |
Re: Try [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1048382857&id=1043284392"]this [/URL]page. |
The End.