1,171 Posted Topics
Re: [QUOTE=ArkM;843239]You declare the first arrAscendingOrder and showArrPtr paremeter as an array of [b]pointers[/b] to double ( Why?! ) [/QUOTE] I also don't understand exactly why he's doing it in that way ... To the OP: Array's names are actually constant pointers to the first element of the array, so if … | |
I haven't tested this on Vista, but it's working on Windows 2000/XP: There's a cheat in minesweeper to activate a pixel in the top left corner of your screen, when you move your mouse over the mine field the pixel will become black if there's a mine, otherwise the pixel … | |
Re: > Can I use .NET with C++ ? >> Yes, you can if you're working with Microsoft Visual C++ (2008) it should be easy to do so ... >> Edit:: [URL="http://en.wikipedia.org/wiki/.NET_Framework"]This[/URL] link might be useful for you ... | |
Re: First, I'm not a PHP professional and please don't blame me if my suggestions aren't working, but maybe you should try this: [CODE=PHP]<a href="./index.php?_act=manageregister&DO=manageProfile&intUserID={$data[i].intUserID}"><span>Edit Profile</span></a> <a href="./index.php?_act=manageregister&DO=manageDesiredProfile&intUserID={$data[i].intUserID}"><span>Edit Desired Profile</span></a> <a href="./index.php?_act=manageregister&DO=manageImages&intUserID={$data[i].intUserID}"><span>Edit Images</span></a> [/CODE] Using double-quotes instead of single ones ... Does that help ? | |
Re: I've found an example on Wikipedia but the information was in Dutch, so I've translated the comments in the code: [U]Singleton pattern in C++[/U] [U].h file[/U] [CODE=C++] class CSingleton { protected: CSingleton(); public: virtual ~CSingleton(); static CSingleton* Instance(); private: static CSingleton* m_pSingleton; }; [/CODE] [U].cpp file[/U] [CODE=C++] //Define static to … | |
Re: [ICODE]simple::~simple[/ICODE] is a destructor and is called automatically when the object is being destructed, you can never call it yourself ... | |
Re: What a crap this code is ? 60% of your code is full of bugs ... Read your textbook first ! By the way, in future post using code tags ... ![]() | |
Re: Actually this: [CODE]outputFile<<"Name: "<<Pname<<" "<<"Date:"<<TDate<<endl;[/CODE] is the same as this: [CODE]outputFile<<"Name: "<<Pname<<"\t\t"<<"Date:"<<TDate<<endl;[/CODE] | |
Re: You'll have to use Javascript to detect mouse events and keypresses within that page ... When a mouse event and/or keypress is detected you just reset the inactivity countdown timer ... Hope this helps ! :) | |
Re: Actually I don't get what you're saying ... So if you have a question can you please reformulate it so we can understand what you mean ? | |
Re: Let me explain this using an example: If we want to store number -6 as a binary value we use the two complement: -> Assume we're working with a byte ... -> If we set all bits of a byte to '1' we get [ICODE]11111111[/ICODE] which corresponds with the decimal … | |
Re: No, in that case it's likely to use another datatype ... The following links might help you: [URL="http://www.nongnu.org/hpalib/"]http://www.nongnu.org/hpalib/[/URL] [URL="http://www.apfloat.org/apfloat/"]http://www.apfloat.org/apfloat/[/URL] (I think this is the best :)) If you want more information on this topic you can always try searching Google for 'C++ high precision' or something ... | |
Re: Yes, the information is correct, but it isn't explaining much (e.g: a namespace is not only used to share some constant values) ... [U]Namespaces[/U]: e.g. a variable called 'animal' declared in[ICODE] namespace A[/ICODE] won't conflict with a variable called 'animal' declared in [ICODE]namespace B[/ICODE] ... [U]Static variables[/U] are often used … | |
Re: Shabtai, could you please post using code tags ? | |
Re: Take a look at [URL="http://winprog.org/tutorial/"]this[/URL] tutorial ... ![]() | |
Re: A '.o' file is normally an object file, are you trying to link an object file to an executable file ? Maybe you should check out [URL="http://www.programmingforums.org/thread7219.html"]this[/URL] also ... [QUOTE=ArkM;843619]Insufficient info...[/QUOTE] Agreed | |
Re: (Assuming the order of the elements will never be changed) > You could read the file line by line ... (and every time you put the line into a string) > Then you only have to scan the string for the character '=' and read out the value after it … | |
Re: What type of variable is X2, I guess it's probably an integer, which can't store floating numbers ... Use a [ICODE]float[/ICODE] instead ... | |
Re: Do you already have a shell ? ;) If not begin with that ... | |
Re: Just use a for loop (which runs 5 times) ... In the while loop you place the instruction [ICODE]sleep(1000);[/ICODE] and you print out the loop index everytime on the screen ... Something like this: [CODE=C++] ... cout << "The program will end in "; for(int i = 5; i > … | |
Re: Why are you hard coding the username and password in the code, if you want to improve your login system (make it more universal) you could make an account database where the username and password are stored in ... Edit:: You could also use a [ICODE]bool[/ICODE] called 'terminate', and you … | |
Re: How many times are you planning to post this code ? I've already seen variations of this code in at least three different threads, but all with a similar question: "This code isn't compiling ..." I'm not blaming you for this because it's a moderator's task to make a judgment … | |
Re: If your compiler is fully ANSI/ISO compliant it should work with all standard C++ code ... | |
Re: Create a file called [ICODE]Proj4_input.txt[/ICODE] in the same directory where the executable file is in ... | |
Re: Did you already notice that your function [ICODE]getString()[/ICODE] actually is returning a value of type [ICODE]int[/ICODE] ? To return a c-string your function has to return something of type [ICODE]const char *[/ICODE] ... | |
Re: Yup, if you're using the [ICODE]getline[/ICODE] or [ICODE]cin.get(charvar, number_of_chrs)[/ICODE] methods/functions, you always have to bear in mind the '\n' character stays in the input buffer ... But as already mentioned there's an extensive thread about it ... | |
Re: If you want to write to Excel files you can use [URL="http://xlslib.sourceforge.net/"]xlsLib[/URL] However I would recommend to use CSV-files (as already mentioned) because they're more C++ friendly and it's just easier to read out the data using some simple file handling techniques ... | |
Re: That's because you're including the file "menu.h" ... In 'menu.h' the whole class is declared so the compiler knows about it ... BTW, While compiling the compiler will put all these files together to one file: the object file ... | |
Re: [QUOTE=sadiekins;843396]After I did that my compiler stopped working. I tried it on Dev C++ and Microsoft Visual C++2008. Both of them stopped working. :([/QUOTE] Could you post me the whole code which broke your compiler ? I would like to try it :twisted: ... | |
Re: [URL="http://www.vias.org/cppcourse/chap16_08.html"]This[/URL] page describes exactly the problem you're having ... | |
Re: Maybe the following information might be useful for you: [URL="http://www.codersource.net/c++_vector_stl.html"]http://www.codersource.net/c++_vector_stl.html[/URL] | |
Re: Did you actually write this code ? | |
Re: Yeah, siddhant is absolutely right !! But [URL="http://www.vias.org/cppcourse/chap08_07.html"]this[/URL] link might be helpful too ... | |
Re: Did you try searching Google ?? Remember Google is your friend ! [URL="http://www.inversereality.org/tutorials/c++/linkedlists.html"]This[/URL] is some simple info about linked lists ... And what about [URL="http://richardbowles.tripod.com/cpp/linklist/linklist.htm"]this[/URL] one ? Or [URL="http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_linklist.aspx"]this[/URL] one (from professor Narue, still not complete, but it covers the basics and it's very detailed) ? | |
Re: That's because the [ICODE]ispunct()[/ICODE]-function is expecting an int as argument, and your vector is of the type string ... What happens if you use [ICODE]static_cast<int>(_word_list[i])[/ICODE] ?? Hope this helps ! | |
Re: Change line 19 to: [ICODE]prime.startnumb >> prime.number;[/ICODE] | |
Re: You could just go through the file and when your program comes across a '<' it should just ignore everything after it until it comes across a '>', at that point you've to count a tag ... | |
Re: It's better to avoid using [ICODE]system("PAUSE");[/ICODE] (look [URL="http://www.gidnetwork.com/b-61.html"]here[/URL] for more info) You could use [ICODE]cin.get();[/ICODE] instead ... | |
Re: Use 'cin' ... Edit:: e.g: [ICODE]cin >> your_variable;[/ICODE] Edit:: e.g: [ICODE]cin >> tside;[/ICODE] | |
Re: I think you should also do some form of syntax checking ... Check what happens if you input [ICODE]56 + 5[/ICODE] ? (with very much spaces between '56' and '+' ... And with very much spaces between '+' and '5') ... You could make a function which reads out all … | |
| |
Re: There's an extensive thread about flushing the input stream, you can find it [URL="http://www.daniweb.com/forums/thread90228.html"]here[/URL] ... | |
Re: Agreed with all above ... To the OP: Please remember that every C++ keyword is written in lowercase, this was introduced to keep everything simple, so actually you don't have to hesitate whether you've to enter an uppercase letter or a lowercase one, it's just always in lowercase ... | |
Re: Where are you having problems with? With defining the class and it's data members (read [URL="http://www.cplusplus.com/doc/tutorial/classes/"]this[/URL]) ? or with writing a program to solve the problem described above (look at lerner's post) ? | |
Re: Please post using code tags ! | |
Re: We can't just give you some code away, sure we can solve this, but it's your homework ... You should first show what you've done so far, and if you get stuck, you post your code and ask specific questions about it ... In fact you could use a simple … | |
Re: [QUOTE=rahul8590;842217]since the person itself has written the code using namepace . i assume that she is working on gcc compiler ,not the old tatted turbo c . thus there isnt any thing wrong with the code i have mentioned .[/QUOTE] Wrong, look [URL="http://www.daniweb.com/forums/thread91229.html"]here[/URL] ... | |
Re: Could you please post using code tags ? BTW, using [ICODE]goto[/ICODE] is a bad practice in C++ ... |
The End.