1,171 Posted Topics
Re: [QUOTE=DaveD3;853388]I have got to say this .NET stuff is very frustrating.[/QUOTE] This frustrating .NET stuff is actually much easier to design a program's GUI in :) ... | |
Re: Or [URL="http://www.cppreference.com/wiki/c/math/start"]this[/URL] but it's pretty much the same :) ... | |
Re: [QUOTE=jinsong;852426]tolower() only works on a per char basis, see the man page here. [url]http://linux.die.net/man/3/tolower[/url][/QUOTE] True :) Try something like this: [CODE=C++] void conv2lower(string &s) { for(unsigned int i = 0; i < s.length(); i++) s[i] = tolower(s[i]); } [/CODE] Usage: [CODE]string msg = "HELLO WoRLd!!"; conv2lower(msg); // msg contains now … | |
Re: Yeah, I tried this, it was compiling ... I stored a value in it but when displaying with cout it didn't display anything ... You're probably better off with a vector: [CODE] // Create vector< vector<int> > vec(512, vector<int>(512)); // Write vec[2][3] = 10; [/CODE] | |
Re: Is this just another "please-do-my-homework" request or what ? | |
Re: Why are there HTML-tags in your post, BTW, ever heard of paragraphs :P ? It's difficult to read this ... | |
Re: Is this a "do-my-homework" request ? Please show us what you already came up with ... Edit:: There are just so many TicTacToe examples floating around on the internet just use Google ... | |
Re: You don't have to specify an array's upperbound if you pass it to a function [ICODE]int fillStruct (ifstream& fin, ROPES ropes[MAXROPES], int n)[/ICODE] change it to [ICODE]int fillStruct (ifstream& fin, ROPES ropes[], int n)[/ICODE] | |
Re: On line 80 of your compressor code I encountered this: [ICODE]system("cls");[/ICODE] first: this has nothing to do with the crashes, but it isn't recommended to use the system command (look [URL="http://www.gidnetwork.com/b-61.html"]here[/URL], this info does also apply to the "CLS" command) As Narue said it's probably an override or out-of-bound error … | |
Re: Again, what is your input and expected output? Yup, please tell us ... | |
Re: What about something like this ? [CODE=C++] #include <iostream> using namespace std; int main() { char chr; while(cin.peek() != '|') { cin.get(chr); cin.ignore(1000, '\n'); /* Put your code here */ } return 0; } [/CODE] | |
Re: [QUOTE=Clockowl;851617] How would I merge these two functions? They have so much it common! It seemed redundant... Is there a way with templates and/or with a function that has the shared code? [/QUOTE] Templates could be an option I think, but isn't overloading a good one ? | |
Re: [QUOTE=niek_e;852073]If this is homework, then tell us what do [I]you[/I] think the output will be and I might test it. [edit] on second look: I already spot one problem: 'i' is not declared, so it won't even compile[/QUOTE] Absolutely right :) Edit:: Avoid using [ICODE]exit(0);[/ICODE] in this case you're better … | |
Re: [QUOTE=elbashamoe;851488]need help with everything dont realy know where i should start[/QUOTE] Split the problem down in several parts which are each easy to understand (this process is also known as abstraction), create a plan before you actually go onto the coding part ... | |
Re: Sure we can help you, post your code, ask questions about what you don't understand and we'll help you out, but remember one thing: we aren't doing any homework for you :), we're just helping you to understand things, in that way you'll become a much better programmer than just … | |
Re: Was there something more difficult ? Davidhoria and Narue are right :) By the way, did you try [URL="http://www.google.com/search?q=c%2B%2B+face+recognition&meta=&aq=0&oq=c%2B%2B+face+re"]searching Google[/URL] ? | |
Re: Please post using code tags, by the way: what's your problem as you didn't tell me :) ... | |
Re: [QUOTE=Sky Diploma;851485][code] #include <..//Folder_Name//File.h> [/code] I think this should work out. You need to traverse to the previous directory and then to a sub-directory.[/QUOTE] Using '<' and '>' works only if the header files are in the compiler's header files directory ... [QUOTE=ArkM;851489]Probably the simplest way to go: [code=c++] #include … | |
Re: [QUOTE=siddhant3s;849942] I would suggest to get a book rather than relying on tutorials. [/QUOTE] Yeah, I would also do so, books are often much better to learn a programming language, but that's just my personal opinion ... Further I can recommend you 'C++ Black Book' (by Steven Holzner) and 'C++ … | |
Re: Can you show us what you've done so far? We're not making your homework ... | |
Re: It's just compiling fine with me (it gives a lot of warnings), I'm using the Borland Compiler ... Edit:: Using the Microsoft C++ compiler (from Visual C++ 2008 Express Edition) I'm also getting this error ... | |
Re: I think there are written lots of books about QT ... Linux desktop environment KDE is also QT-powered ... But personally I think wxWidgets is easier to learn, actually you should just try both of them, and stay with the one you feel yourself most comfortable with :) ... | |
Re: I think Microsoft backup is able to do that, but it will be a more pleasant experience if you just use [URL="http://www.acronis.com/"]Acronis TrueImage[/URL] which is designed for that purpose ... | |
Re: Please post using code tags, can you also please tell me what problem you're having ? | |
| |
Re: [QUOTE=ihatehumans;849187]As part of an assignment I am creating a class to handle rationals with numerators and denominators, overloading the operators for cin and cout, [U][B]as well as +-*/[/B][/U]. So these are the functions for those operators, now where exactly should I include these in my class? [code] Rational addition(Rational a, … | |
Re: Why are you using old casting ? [QUOTE=ShadowScripter;848444] [CODE] double test2_calc = [B](double)[/B]10/[B](double)[/B]5; const int test2 = [B](int)[/B]test2_calc; [/CODE] [/QUOTE] It's a better practice to use the new casting operators to do conversion between datatypes: [CODE] double num = 5.23; int num2 = [B]static_cast<int>([/B]num[B])[/B]; [/CODE] instead of the old ones: … | |
Re: [QUOTE=Narue;94028]Why? This is a suspicious activity, so we need a good reason before helping you with it.[/QUOTE] Yeah, that's indeed a suspicious activity ... [QUOTE=Bladtman242;849280]Why does it need to be before logon?[/QUOTE] Good question, it's much easier to implement if it's after the logon process :) ... | |
Re: [QUOTE=yazooney;664349] What I want to know is how do I set up and use a proxy to intercept the data files sent and then transfer the data to a file so it can be read?[/QUOTE] Intercepting data, that's actually the base of a firewall :) ... Edit:: The following post … | |
Re: Why don't you try it yourself first ? > Get the input (the age) from the user > Use some conditional statements ( [ICODE]if(condition) { /... }[/ICODE] ) to check whether the script has to grant access or not > Now you only need a command which redirects the user … | |
Re: I don't think it's possible in your way, you should declare an array of pointers instead if you want to delete individual elements ... | |
Re: It's always nice if you can solve your problems yourself, congratz :) ... (It was indeed a beginners mistake, but never mind it can overcome anyone) | |
Re: [QUOTE=kiwihaha;849347] [CODE] struct AXEMAN axeman; struct DEFENDER defender; struct ARCHER archer; struct ROUGE rouge; struct SPEARMAN spearman; [/CODE] [/QUOTE] In C++ you don't have to supply the 'struct' word each time before you declare a struct-variable, though it's still allowed to do so, you can save some typing :) ... … | |
Re: Yup, first read the forum rules and by the way people here usually don't respond to questions like: 'Please I want someone to help me' You need to show us what you've done so far (forum rules), it's a nice assignment and it isn't too difficult, so give it a … | |
Re: Yup, fstream's open-method only accepts a c-string as it's argument for the filename, so you'll have to convert your C++ string to a c-string first, you can easily do this by using the [ICODE]c_str()[/ICODE] method of the string class :) ... | |
Re: The following code should work: [CODE=C++] void trim(string & s) { int strlen = s.length(); string tmp; for(int i = 0; i < strlen; i++) if(s[i] != ' ') tmp += s[i]; s = tmp; } [/CODE] > Why are you using a seperate counter 'k', you can just add … | |
Re: [U][I]FILENAME[/I].BAT[/U] [CODE] @ECHO OFF fsutil.exe fsinfo statistics c: [/CODE] Save this under [I]filename[/I].bat and it will run the requested command :) ... Edit:: Replace [I]filename[/I] with an appropriate filename ... | |
Re: [QUOTE=r.stiltskin;848912]Did you read this: [url]http://www.daniweb.com/forums/announcement8-3.html[/url][/QUOTE] Apparently he didn't :P ... You could use the 'list'-container from STL if you want linked lists ... (Look [URL="http://www.cprogramming.com/tutorial/stl/stllist.html"]here[/URL] or [URL="http://www.cplusplus.com/reference/stl/list/sort/"]here[/URL]) Or are you supposed to do without ? | |
Re: There's nothing wrong with using the goto-statement, but overwhelming use of it makes your code very difficult to understand and extremely hard to debug, so my advice is: avoid it as much as you can and use it only when there's no other possibility left :) ... | |
Re: What about the following ones ? > [URL="http://mattmccutchen.net/bigint/"]http://mattmccutchen.net/bigint/[/URL] > [URL="http://sourceforge.net/projects/cpp-bigint/"]http://sourceforge.net/projects/cpp-bigint/[/URL] Edit:: If you're using one of these libraries it's easy to write your own modPow() function :) ... | |
Re: [QUOTE=dmytro;848389]Try this library - [url]http://www.libxl.com[/url][/QUOTE] Yeah, but it isn't a free one, try searching [URL="http://www.wotsit.org/"]wotsit.org[/URL] instead ... Maybe the following link is also useful for you: [URL="http://chicago.sourceforge.net/"]http://chicago.sourceforge.net/[/URL] | |
Re: Can you post the code which is causing the error (using code tags :P), as the code you posted is compiling with me ... | |
Re: Hmm, to use of the [ICODE]getline[/ICODE] function makes me think about the following thread: [URL="http://www.daniweb.com/forums/thread90228.html"]http://www.daniweb.com/forums/thread90228.html[/URL] | |
Re: [QUOTE=nucleon;848436]Replace [icode]in.ignore();[/icode] with [icode]continue;[/icode] to "ignore" the current character in n.[/QUOTE] That's definitely the way to go !! :) | |
Re: Just image recognizing only won't solve the Mahjongg game, as the program also has to respect the rules of the game, but I assume this isn't the problem ... | |
Re: I think the following algorithm is a better one: If you know the starting number of the interval: -> Check whether the sum of it's digits are even (you could use the modulo operator for this) -> If the sum was even, you automatically know the next number's sum of … | |
Re: [URL="http://www.cplusplus.com/doc/tutorial/basic_io.html"]This[/URL] will show you how to do some basic interaction with the user ... And [URL="http://www.codersource.net/cpp_tutorial_class.html"]this[/URL] information about C++ classes might also be helpful ... Hope this helps ! | |
Re: On line 98 I'm also getting an error when I'm compiling this: [CODE] Error E2141 testt.cpp 98: Declaration syntax error [/CODE] | |
Re: To display a form from within a PHP script you can do the following: > Use the echo-command to write the HTML-code (which is displaying the form) directly to the webpage > You put the HTML code to view a form outside the PHP-tag(s) You could also check out [URL="http://www.tizag.com/phpT/examples/formex.php"]this[/URL] … |
The End.