- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 4
- Posts with Upvotes
- 4
- Upvoting Members
- 4
- Downvotes Received
- 2
- Posts with Downvotes
- 1
- Downvoting Members
- 2
Software Engineer
54 Posted Topics
Re: Please refer to this link. It may be helpful. [url]http://www.codeproject.com/KB/database/cspreadsheet.aspx[/url] | |
Re: I've found the following link helpful. [url]http://www.codeguru.com/forum/archive/index.php/t-269582.html[/url] | |
Re: Are you using Turbo C++? Make sure that the include directory (in the menu of turbo C++ IDE) contains the exact location where iostream.h resides. | |
Re: Why don't you try developing an algorithm at least? | |
Re: A binary file may contain multiple eof characters. So take the size of the file and loop to the total size / till you find the required binary number. | |
Re: [QUOTE=RFBourquin;467664]I can't seem to find any function which will allow me to obtain the Windows screen resolution and/or set it in C++. I would like to be able to change it, then change it back. Thanx[/QUOTE] To get the screen resolution, you can use the function [B]GetWindowRect()[/B]. I've written an … | |
Re: The easiest way is to send the value from one dialog to another is to use PostMessage(). | |
| |
Re: VC++ 2005 with TR1 extensions provide extensive support for regular expressions. On the other hand, there are some free libraries (say, boost) which provides regular expression libraries for VC++. | |
Re: STL is not thread safe. Try to use mutexes to guard them. | |
Re: The map as a whole can not displayed using cout. Try [QUOTE]cout << *mp0_iter.first() << *mp0_iter.second() << '\n';[/QUOTE] | |
Re: Why are you hesitant to use Visual C++? There you can use either MFC or .NET framework. | |
Re: You are missing the loop termination conditions in the for loops in the lines where compilation errors occur. | |
Re: [CODE]coordinate blah = place(b); double x = blah.getx(); double y = blah.gety(); [/CODE] I hope this is what you need. Also, make member variables x and y of class coordinate private or protected. | |
Re: Instead of [CODE] NodeSmall *docNum = new NodeSmall;[/CODE] you have to use [CODE]head->docNum = new NodeSmall;[/CODE] | |
Re: Basically, it is a block of code identifies with a name. | |
Re: Have you forgotten to have a function body for StudentList::getStream()? | |
Re: This might be helpful. [url]http://www.devx.com/getHelpOn/10MinuteSolution/16972/0/page/3[/url] | |
Re: Can you paste the scanf statement? Have you forgotten to use the & operator? [I]<<snip>>[/I] | |
Re: In fact I didn't understand what you mean using this program. I see that there is a statement [CODE]fin.open(filename);[/CODE] which tries to open a file with an uninitialized name. Then, [CODE]fin >> size;[/CODE] This will try to copy the value of fin, which is an ifstream variable to size. What … | |
Re: Can u check if ur include directories are set properly? You can check it in Options- > Project and solutions -> VC++ directories. [I]<<snip>>[/I] | |
Re: To use find function, you have to implement operator < in the key struct. Then it will be ok. Once I had a similar problem in sorting a vector and I have written it in my blog. [url]http://cppkid.wordpress.com/2008/09/19/how-to-sort-a-vector-with-non-number-elements/[/url] Hope this will clear your issue. | |
Re: > The following is a statement from a program on linked lists given to us in class. I do not understand why I have to add & for address when what is passed is a pointer which means it is passed by reference.: void CharNode::headInsert(CharNode* &head, char *d) { head … | |
Re: Other than that, in function assign , you are using local variables, which make it meaningless. | |
Re: I think it is because of buffering of cout. A call cout.flush() may help. (I didn't try it. So pls excuse if it is wrong) | |
![]() | Re: I'm not sure if C++ permits that. Better you can try Animal* a1 = new Animal(); Animal* d1 = new Dog() Then you can use dynamic_cast, if needed |
Re: If you are afraid of delete, using auto_ptr can be a good option. | |
Re: A general way is to flush the input stream (instead of using getchar()). Use [QUOTE]fflush(stdin)[/QUOTE] | |
Re: However, having multiple exit points for a function makes it difficult to maintain. There is a greater chance that you'll forget to do the clean ups (which will be usually at the end of the function). | |
Re: Is the value of [B]result != NULL[/B] when you invoke the function? I don't see you do a [B]new [/B]operation on result anywhere in the function. As you stated, if it is really non-null, the program would crash because you are accessing the member functions of result in a number … | |
Re: Why are you trying to read a double using "%d"? Use "%lf" instead. [QUOTE]scanf("%lf",&grade2);[/QUOTE] | |
Re: You don't have to go upto sqrt(num). The loop may be like this. [QUOTE]for(int i = 2; i < sqrt(num); i++)[/QUOTE] | |
Re: Try this. [url]http://cppkid.wordpress.com/2009/02/18/how-to-round-off-a-number/[/url] | |
Re: To sort an array, see the following article. It is simpler than you writing your own algorithm. [url]http://cppkid.wordpress.com/?s=how+to+sort+an+array[/url] | |
Re: The problem is that when your function is returning a string, it first makes a copy of the string to be returned (in your case, it is NULL). For making copy, it has to take the length of the original string. Of course, strlen(NULL) fails. You can make your string … | |
Re: This may be helpful to round off a number. [url]http://cppkid.wordpress.com/2009/02/18/how-to-round-off-a-number/[/url] | |
Re: The problem seems to be in [ICODE]while(isalpha(ch)) { text[i] = ch; i++; }[/ICODE] If the first character is an alphabet, it will go on filling the array text with that character and this is almost an infinite loop as isalpha(ch) never fails. As the max. size of text[] is only … | |
Re: [QUOTE=viki0077;806645]Does anyone now answer to this: Suppose class X includes a data elements common declared as public. How can it be accessed by all functions in the same name space ?[/QUOTE] The question is not much clear to me. I assume that you have a class with a public member, … | |
Re: [QUOTE=jencas;800976][code] found = (*point).find("test"); [/code][/QUOTE] Exactly........ Have a better practice to initialize [B]Point [/B]at the time of declaration. | |
Re: I'm not sure what type of a vector stuAns is. If it is a vector of char*, you have to use strcmp() instead of checking with the operator !=. | |
Re: The operators like . , -> and * can not be overloaded. | |
Re: I think you can simply check if the first character is a numeral. | |
Re: only the first example invokes copy constructor. If the second one needs to work in the same manner as copy constructor does, you have to overload the assignment operator. | |
Re: isn't it possible to use a map rather than using two separate vectors? Then, I think, the entire problem will be solved. | |
Re: Sorting the stack is easy. I have written in my blog how to sort an array in simple steps. [url]http://cppkid.wordpress.com/2008/09/18/how-to-sort-an-array/[/url] Hope this will clear your problem. | |
Re: Instead of the line Foo* f = new Foo[2]("Hello"); you have to use [CODE]Foo* f[] = {new Foo("Hello"), new Foo("Hello"));[/CODE] Then for deleting, you have to iterate throgh each element of the array. [CODE]for (int i = 0; i < 2; ++i) { delete f[i]; }[/CODE] A better method is … | |
Re: p is the object itself (just another name for *obj, not obj). References are internally treated as pointers. However, it is hidden from the programmer. | |
Re: [QUOTE=72246;778739]calculate the value of pi from in finite series pi=4-(4/3)+(4/5)-(4/7)+(4/9)-(4/11).... print a table that shows the approximate value of pi 1,000 terms series[/QUOTE] How the value of PI can be printed as a table? | |
Re: [QUOTE=smithss;778651]Hi, so i wrote a few of the programs on my own after all the help previosuly but i've got stuck in this one here. The point is the make the string alteast 'n' characters long by padding spaces to its right. [code=c++] #include <iostream> using namespace std; void padRight(char … | |
Re: [] operator is the best to add values to an array, I think. Applicable only if you know the index in advance. If you have to search in runtime for the position to which we can add a value, it will have a complexity of O(n). In that situation, if … |
The End.