2,839 Posted Topics
Re: To find out how many 'watts' your computer uses, just wack a multimeter between the computer and the poweroutlet and set it to 'current'. Read what the display says and then multiply that by the voltage in your country. You answer will be poweruse in watts. P=I.U | |
Re: This code doesn't do much does it? Why does the user have to input the file for the grid? Is this a startup grid, or is the file meant for ouput when the game is done? You should also think about how to implement the logic of the game. ps. … | |
Re: [QUOTE=Narue;674782]with code that would have worked beautifully fifteen years ago[/QUOTE] Not to nittpick, but 'cout' never belonged to the C-language, not even 15 years ago on a Turbo-C compiler :D | |
Re: () isn't a operator. Do you mean function-overloading? [code=cpp] int foo(int bar) { return bar*2; } float foo(float bar) { return bar*2.0f; } [/code] In the above example, I've created two functions with the same name and functionality. But one is for ints and one is for floats => function … | |
Re: what's a wlc file? Is it [URL="http://filext.com/file-extension/WLC"]power word[/URL]? If yes: It's just a textfile, so open it like this: [code=cpp] #include <iostream> #include <string> #include <fstream> int main() { std::ifstream in; std::string line; in.open("c:\\input.txt"); // check if file is open here // and do something with it's contents return 0; … | |
Re: If you change [icode] div.pushback("a");[/icode]to [icode] div.push[b]_[/b]back("a");[/icode], your code should actually produce the output you want. ![]() | |
Re: [QUOTE=OmniX;673915]On the topic of pause, you got one for cls? [/QUOTE] [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1031963460&id=1043284385"]Here [/URL]are a few options. I prefer option 4 myself :) | |
Re: [QUOTE=camthalion95;641685]CoolGamer48 Beat Me to mentioning shadowrun.[/QUOTE] It took you 3 days to type that reply? :-/ | |
Re: [QUOTE=Ancient Dragon;673095] But with special software (I forget its name) you can run it under *nix too.[/QUOTE] I think you mean Wine. @sciwizeh: you [i]can[/i] make programs with Visual for other Operating systems, but for drawing you should use something like wxWidgets (as Ancient Dragon mentioned) instead of the win32-api … | |
Re: [URL="http://www.daniweb.com/forums/thread78250.html"]Here's[/URL] a 13 page thread that covers 'bout everything there is to know about Rep. Enjoy :) | |
Re: [QUOTE=John A;589297]Here's my list of things I hate: [list] [*]Posting Games [*]Geek's Lounge [*]....... [/list] [/QUOTE] You hate the Geek's lounge, but you have 500 posts in it? Very strange... Anyway: I'd like to add the parsing of smilies in [noparse][icode][/icode][/noparse] tags to the lists of things Example: [noparse][icode][/icode][/noparse] [icode] … | |
Re: Why would you want to program it in assembly? AVR-studio can compile C for the 89s51. So the code would look like: [code=c] char i; for (i=99; i >0; i--) { //write 'i' to 7-seg } [/code] Without knowing how you connected everything, that's all I can tell you | |
Re: You should change the "< >" to quotes ( " " ): [icode]#include "bfunction.cpp"[/icode] This means that the file is in de project-folder If you want to use multiple files I would recommend that you use .h files. For example: You have a function [icode]void foo(int number) { }[/icode] You … | |
Re: [QUOTE=~s.o.s~;651563]Yes, the concept seems to be useful, at least for those who are new to forum based systems though the downside here is that regular posters will have to go through an extra click to post their replies.[/QUOTE] My thoughts exactly. But you could keep the current system for people … | |
Re: Same bug exists in the search-function. I mentioned it [URL="http://www.daniweb.com/forums/post629027-116.html"]a month[/URL] ago. And I think the 60 seconds interval between sending emails is too long. If I see someone spamming, I always 'report bad post'. But I have to wait 60 seconds to report the next spam-message... I don't like … | |
| |
Re: What he ^^ said. But also this line: [icode] srand(time(NULL)); //seed random number generator[/icode] should be called once and only once. I normally put it somewhere at the beginning of main() | |
Re: I like VS2008 (VC++ Express) the best. It's free and it's backwards-compatible with VC6. VC6 isn't freely available (to my knowledge). What problems do you have with the new visual IDE? Perhaps we can assist. | |
Re: [QUOTE=Salem;650170] But if you're going to use precompiled headers, then EVERY source file needs to look like this [code] /* Every source file needs these headers */ #include <iostream> // just an example /* The precompiled header magic marker */ #include "stdafx.h" /* any header files unique to a source … | |
Re: Do you mean [URL="http://msdn.microsoft.com/en-us/library/k3bb4tfd(vs.80).aspx"]deployment[/URL]? Here's another [URL="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1790835&SiteID=1"]thread [/URL]on the subject. What version of VS are you using, because I'm not sure if these solutions will work on the Express-version | |
Re: Or you could download the [URL="http://msdn.microsoft.com/en-us/vs2005/aa718668.aspx"]90-day tria[/URL]l of Visual Studio Pro. After the 90 days, you can decide to buy or uninstall. | |
Re: Yeah, cause we all know gremlins eat positive reputation :D I've noticed the same bug. It has been that way since you can view 'all your rep'. But if the gremlins want to eat the newest rep, that's fine with me. | |
Re: [QUOTE=Lukezzz;654671] [code] vector<vector<vector<string[COLOR="red"]>>>[/COLOR] [/code] The 2D compiles and I have tried to follow the pattern for the 3D but I have a lot of compilererrors with the 3D.[/QUOTE] You should write it like : [icode] vector<vector<vector<string[COLOR="red"]> > > [/COLOR]abcde; [/icode] (with spaces between the >>>.) Else the compiler will think … | |
Re: The answer would be vectors: #include <iostream> #include <vector> using namespace std; int main() { const int maxsize = 9000000; vector<int> lst; lst.resize(maxsize); for(int i = 0; i < maxsize; i++) lst[i] = 0; return 0; } To add array's, you could use a vector of vectors, or a [map](http://www.cppreference.com … | |
Re: [URL="http://www.daniweb.com/forums/announcement8-2.html"]Nope.[/URL] | |
Re: The bar isn't long enough for my clicking skills.. [quote] Near Death - Delusions of Godlike power[/quote] (I play (hardrock)guitar, so I have a lot of speed in the fingers on my lefthand :P ) ![]() | |
Re: [QUOTE=Brent.tc;653957]Thanks Salem![/QUOTE] It took you 7 months to reply ? :-/ :D | |
Re: [QUOTE=Adak;650352] 1) get input, either from file, or from the user, using fscanf(), or scanf(). [/QUOTE] A bit of-topic, but a moderator (WaltP) once wrote [URL="http://www.gidnetwork.com/b-59.html"]this [/URL]article about scanf(), it's worth the read. (also click the other parts about scanf) For the rest I completely agree with your post! | |
Re: What Ancient Dragon said ^^, But don't forget do [icode]delete ptr[];[/icode] once you're done with it. Or else you'll get a memoryleak. | |
Re: [QUOTE=camilojvarona;653235] I've found a workaround you just need to initialize the array first like this. [icode]int arrays[1][/icode] and then you can do like this [icode] arrays[arrayLength];[/icode] [/QUOTE] If you mean that you're doing something like this: [code=cpp] int a[1]; a[2] = 9; cout << a[2]; [/code] then I can only … | |
Re: As for the first code: instead of this: [icode]if ((number > 99) || (number < 1000)) [/icode] I think you mean this: [ICODE]if ((number > 99) && (number < 1000))[/ICODE] which means that the number has to be between 100 and 999. also: [ICODE]d2 = (num / 100) [COLOR="red"]mod [/COLOR]10;[/ICODE] … | |
Re: Without looking for any other errors, or checking the functionality of your code, I can see that in quad.h you have an extra closing bracket: [code] .... cin >> dy; }; } [COLOR="Red"]<--- remove this one[/COLOR] ~Quadrilateral() // Call Destructor .... [/code] If you used [URL="http://en.wikipedia.org/wiki/Indent_style"]code-formatting[/URL] and [URL="http://www.daniweb.com/forums/misc-explaincode.html"]code-tags[/URL], you could … | |
Re: Wrong password/username? Are you logged in as admin? | |
Re: What's the return-value of [URL="http://msdn.microsoft.com/en-us/library/ms646940(VS.85).aspx"]PrintDlg[/URL]()? | |
Re: [QUOTE=vbCNEW;650245]im not sure if i download all file they say... i never found a external libraries they were claiming... is it all the links??? [/QUOTE] I went to clanlib.org and clicked downloads->Win32, Microsoft Visual C++ 8 (precompiled binaries). There's a link [URL="http://www.clanlib.org/download-binaries-win32-vc80.html"]there [/URL]that says: "[B]For the lazy[/B]: All libs required … | |
Re: - What compiler/OS are you using? - Console app or GUI? - How is the data saved? The next thing would be to save the text at intervals. If your program runs in a loop, you can compare the current time with a preset time to get an interval, or … | |
Re: This line: [icode]<< "\nThe cost is $ " << box.calculateCost() [/icode] is probably causing the problem. The function calculateCost() isn't returning anything (void). To solve the problem, you should delete the function declaration from TwoDayPackage and OverNightPackage. The class 'Package' already has a calculateCost-function, so why make 2 more? [edit]Too … | |
Re: your statement should actually work. Perhaps you got the path wrong? You could try something like: [code=cpp] system("c:\\mydir\\heres_the_file\\main.exe")[/code] Is it absolutely necessary to open main.exe? I personally don't like the system() command, because if someone would replace the "main.exe" program with a renamed version of "format C: /q" you would … | |
Re: I started with the Atmel [URL="http://www.avrfreaks.net/index.php?module=Freaks%20Tools&func=viewItem&item_id=115"]STK500 [/URL]starterkit and a [URL="http://www.atmel.com/dyn/resources/prod_documents/doc2503.pdf"]ATMega32 [/URL]uController. It's not that expensive, and you get a few tools (software) with it. Also: it has build in rs232 and some buttons and leds and stuff. Very handy when learning the basics in microcontrollers. I know that some people … | |
Re: [QUOTE=Fault;650315]Hey i have a few random questions that i can't seem to get my head around at the moment.[/QUOTE] This smells like homework to me. And we [URL="http://www.daniweb.com/forums/announcement8-2.html"]don't give away free homework[/URL] here. How about you try to answer the questions yourself and come back with what you have. We'll … | |
Re: [QUOTE=jasimp;641484]. Only moderators can use animated avatars.[/QUOTE] Actually.... Everyone can use an animated avatar. Look closely at mine for a few seconds ;) (yes it's animated) | |
Re: What Agni said. But if you want to make your life a whole lot easier, use std::strings: [code=cpp] #include<iostream> #include <string> using namespace std; int main() { string buff = "Asto.cfg"; cout << buff << "\n"; if(buff=="Asto.cfg") cout<<"Success"; else cout<<"Fail!!!!"; cin.get(); return 0; } [/code] | |
Re: [QUOTE=sangham;650382]Friends can i return a list or a map from a function???[/QUOTE] Why don't you just try it? [code=cpp] map<int, string> Foo(void) { map<int, string> Bar; return Bar; } int main() { map<int, string> mp = Foo(); return 0; } [/code] Works? Question answered :) | |
Re: [QUOTE=OmniX;650086] Using <iomanip> and setprecision() but I cant seem to get it to work. Could someone please give me a small example. [/QUOTE] ok: [code=cpp] float a = 0.00012354684; //number has 8 meaningfull digits (skip the first zero's) cout << setprecision (8) << a << "\n"; cout << setprecision (5) … | |
Re: It sounds like an e-mail bombing program, so you're probably not going to get much help here. (and I'm not discrimination. The fact that you are a furry doesn't matter to me) | |
Re: [quote=OmniX]There all just C++ compilers, correct?[/quote] No. They are all IDE's (Integrated Development Environments). The compiler is just a part of it. [quote=OmniX]Which one is the best? [/quote] I personally like VC++, it has a lot of very handy features. But the other two programs have a smaller footprint and … | |
Re: [QUOTE=kv79;649660] I am ready for bombarding .[/QUOTE] Time for a moderator? | |
Re: It's horrible, I should neg-rep you for posting this. I'm constantly stopping random pages from loading. My colleagues were not amused :) One add-on I [i]do[/i] like is [URL="http://piclens.com/"]piclens[/URL]. It makes surfing youtube even better! | |
Re: [URL="http://www.daniweb.com/search/search.php?q=Final+year+Project"]Final year projects[/URL] [URL="http://www.daniweb.com/forums/thread67837.html"]C/C++ practice-problems [/URL] Also: read [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]this[/URL], the part about "keeping it clean" |
The End.