Forum: C++ Nov 4th, 2009 |
| Replies: 14 Views: 446 To avoid buffer overflow, prefer using cin.getline(char_ptr, size);
>> With that code, calling the >> operator will always store it into appt.subject, but what about storing information to... |
Forum: C++ Nov 4th, 2009 |
| Replies: 14 Views: 446 The problem is again sort of same. appt.subject = new char[strlen(ptr) + 1];. Neither ptr holds any string nor it point to any dynamically allocated memory and you are still trying to calculate its... |
Forum: C++ Nov 4th, 2009 |
| Replies: 14 Views: 446 Its happening because subject is not pointing to a valid address, basically you haven't allocated memory to it. Either use char subject[size] or allocate memory in constructor using malloc() or new... |
Forum: C++ Apr 6th, 2009 |
| Replies: 0 Views: 752 The given code snippet checks whether a given string is a part of other string and wildcard are allowed. |
Forum: C++ Apr 5th, 2009 |
| Replies: 12 Views: 2,799 Oops...I just missed a point in previous post. Anyway the loop gotta look like this.
//take matrices values before starting
for (int i=0; i<6; i++)
{
for (int j=0; j<6; j++)
{
... |
Forum: C++ Apr 5th, 2009 |
| Replies: 12 Views: 2,799 First of all replace M[i][j] = m1[i][k]*m2[k][j]; with M[i][j] += m1[i][k]*m2[k][j];. See the algorithm in above post, for explanation. Also dont forget to set M[i][j] value to 0 before running third... |
Forum: C++ Apr 3rd, 2009 |
| Replies: 12 Views: 2,799 What you have done is multiply corresponding elements of matrices. However its not so. First of all the two matrices should not be necessarily of same dimensions. It should be rather of form NxP and... |
Forum: C++ Mar 4th, 2008 |
| Replies: 16 Views: 1,531 > ok i think i will learn C++, what is the best compilier to use?
I say, try many compilers to make your code portable. And yes compiler must be compatible with standard ansi c++. So don't start... |
Forum: C++ Mar 4th, 2008 |
| Replies: 16 Views: 1,531 > ok i think i will learn C++, what is the best compilier to use?
I say, try many compilers to make your code portable. And yes compiler must be compatible with standard ansi c++. So don't start... |
Forum: C++ Jan 11th, 2008 |
| Replies: 4 Views: 1,297 Use you command promt and run. Or if you want to run it directly add std::cin.get() at the end of main() to wait for a keystroke. However this wont work under certain circumstances as mentioned here... |
Forum: C++ Jan 4th, 2008 |
| Replies: 3 Views: 679 This is typecasting (http://www.cplusplus.com/doc/tutorial/typecasting.html), i.e. changing a data from one type to another. Both are same and works same. Enumerators are nothing but named integer... |
Forum: C++ Jan 3rd, 2008 |
| Replies: 4 Views: 765 What linker errors are you getting? You have just declared the function paidout() but not defined it. And perhaps you have called it somewhere else. Also if you think thats the whole program then its... |
Forum: C++ Jan 3rd, 2008 |
| Replies: 15 Views: 1,373 > everybody runs to get the latest copy for no reason
Someone wants latest version not for intellisense, but for updated compiler with bugs fixed, compatible with latest standards etc.
And I see... |
Forum: C++ Jan 3rd, 2008 |
| Replies: 7 Views: 909 Borland apart for C++ Compiler 5.5 also distributes a free IDE called Turbo Explorer C++. You can get that at www.turboexplorer.com. |
Forum: C++ Jan 3rd, 2008 |
| Replies: 4 Views: 1,520 Yes windows.h, if you are using windows. And the function name is Sleep() not sleep() |
Forum: C++ Dec 11th, 2007 |
| Replies: 10 Views: 1,182 No, back() return reference. |
Forum: C++ Nov 29th, 2007 |
| Replies: 4 Views: 2,046 I think you are talking about CBSE 12th class project. I'm too 12th class student and writing my project myself and I advise you to write yours yourself only or you will be in GREAT trouble. The... |
Forum: C++ Nov 20th, 2007 |
| Replies: 5 Views: 1,782 Take number as string. Also long int, long long etc etc may take number till 10 digits. |
Forum: C++ Oct 16th, 2007 |
| Replies: 3 Views: 2,316 Tutbo C++ 3 is very old compiler. You should move to modern ANSI compilers ( not if your teacher asks you to use it :), no other choice left).
Well to use mouse in Turbo C++ 3 you will use dos.h.... |
Forum: C++ Oct 13th, 2007 |
| Replies: 7 Views: 1,757 Ok got it. I reckon standard function in ctype, would be the best practice. But, is there any way to implement a portable function for this?? |
Forum: C++ Oct 13th, 2007 |
| Replies: 17 Views: 10,123 The program you are discussing is a Windows program which uses Win32 API library.
In resource.h you may get error if you havn't left a blank line at the end.
If you dont know what hInstance or... |
Forum: C++ Oct 13th, 2007 |
| Replies: 6 Views: 3,322 You may use getline() . Here's tutorial (http://www.cplusplus.com/doc/tutorial/files.html)on file i/o. Read and try yourself, if you encounter any problem you can post here. |
Forum: C++ Oct 13th, 2007 |
| Replies: 7 Views: 1,757 > Your program is wrong. iostream.h is not a valid c++ header file, IOSTREAM is.
Right, but maybe his teacher expects him to use old compilers like Turbo C++, like my syllabus and teacher :)
>... |
Forum: C++ Oct 11th, 2007 |
| Replies: 22 Views: 7,425 If getnumber() doen't ask for values but just shows them, it would look like this
int findbig(int a, int b)
{
// will return -1, if a is greater
// 0 if both are equal
// 1 if b... |
Forum: C++ Oct 11th, 2007 |
| Replies: 7 Views: 1,757 You could add a simple infinite loop for that, and set a condition that if input character is something other than lower case it would break:
while( 1 ) {
cin >> b;
if( (b < 'a') ||... |
Forum: C++ Oct 11th, 2007 |
| Replies: 2 Views: 1,091 Well, simplest way for that you could create another integer called sum. Then you may create a loop and each time ask for input, place a condition to terminate:
while( (choice != 'N') && (choice... |
Forum: C++ Oct 11th, 2007 |
| Replies: 2 Views: 1,091 Well, simplest way for that you could create another integer called sum. Then you may create a loop and each time ask for input, place a condition to terminate:
while( (choice != 'N') && (choice... |
Forum: C++ Oct 10th, 2007 |
| Replies: 2 Views: 659 Maybe this (http://www.daniweb.com/forums/announcement8-2.html)and this (http://www.daniweb.com/forums/faq.php?faq=daniweb_policies)would help you. |
Forum: C++ Oct 4th, 2007 |
| Replies: 1 Views: 938 A little google search gave me this (http://msdn2.microsoft.com/en-us/library/bb248591.aspx). This would require ATL. |
Forum: C++ Sep 24th, 2007 |
| Replies: 9 Views: 843 Make a function which takes your 2d array as an argument. Iterate through that array, and then print character X or O. Put some kind of line like '|' after it. Insert a new line where you will just... |
Forum: C++ Sep 24th, 2007 |
| Replies: 9 Views: 843 |
Forum: C++ Sep 24th, 2007 |
| Replies: 2 Views: 598 Which version of djgpp are you using. If it is prior to 2.04 it wont work. Read it here (http://www.delorie.com/djgpp/doc/kb/kb_6.html). Try using Sleep() function. |
Forum: C++ Sep 24th, 2007 |
| Replies: 9 Views: 843 Write everything on paper i.e. problems and solution that you guess, write algorithm and flowchart before you start coding. This will show you way.
To make grid make a 2D array for 3 row and... |
Forum: C++ Sep 24th, 2007 |
| Replies: 7 Views: 1,145 These are Windows specific functionis related to INI files which are Windows Configuration files, so there couldn't be any standard function. |
Forum: C++ Sep 22nd, 2007 |
| Replies: 7 Views: 1,029 HTML file are simple text files, with extension .htm or .html. When you open it with browser you see it formatted and when you open it with notepad or any other editor you see its source code.... |
Forum: C++ Sep 22nd, 2007 |
| Replies: 7 Views: 1,029 If you mean copying through C++, then Ancient Dragon has given nice piece of advice otherwise if you mean copying later like a normal guy.
Then there is no relationship between DOC files and HTML... |
Forum: C++ Sep 22nd, 2007 |
| Replies: 1 Views: 6,588 a) Absolute temperature in Celsius is -273C. Convert it to Fahrenheit and put an if condition wafter taking input.
b) To give output into this form try this:
int oFeet = inches/12;
in oInches... |
Forum: C++ Sep 22nd, 2007 |
| Replies: 7 Views: 1,029 By, DOC I suppose you mean document file(MS Word). To generate that kind of file you will need some library. I dont know if there is any free available but you could look into OpenOffice source code... |
Forum: C++ Sep 19th, 2007 |
| Replies: 6 Views: 2,788 I think there is no way in Standard C++. You will have to use your OS API.
In old non standard compilers there used to be stdprn stream for windows and DOS, but now no longer supported(and ofcourse... |
Forum: C++ Sep 19th, 2007 |
| Replies: 2 Views: 903 I would refer book C++ Programming Language by Bjarne Stroustrup. Or you could google and get several links. |