15,300 Posted Topics
Re: >> scanf("%d", av[x]); replace variable x with y. there is no need to pass variables y or z to function avg. Just make them local variable in that function. | |
Re: Q: Why did the man wear his glases to bed at night? A: So he could see his dreams in technicolor :mrgreen: | |
Re: a class can have more than one constructor. write another constructor that takes the parameter you want. [code] class Class1 { public: Class1(); // default constructor Class1(int array[10], int size); }; [/code] | |
Re: I still have VC 1.52C -- the last MS-DOS compiler. And it still works, if you want to write 16-bit console programs. It doesn't really matter how old your compiler is if it does what you want it to do. But don't assume you can learn to write good c++ … | |
Re: I don't reall know pascal, but most languages are pretty much the same. You can do it one of two ways: 1. read the file one character at a time and write the character just read to another file. When a space is read replace it with a tab and … | |
Re: >>#include <iostream.h> that file is obsolete, unless you are using a realy old compiler such as Turbo C++ [code] #include <stream> using std::cout; using std::endl; using std::cin; [/code] >>39 C:\Dev-Cpp\Statics Project.cpp name lookup of `i' changed for new ISO `for' scoping i declared in the for loop only has scope … | |
Re: how about a program like what you see in resturants to calculate the customer's bill. Has a menu of food items, you select the items you want and it calculates the total, tax and tip. It could also keep track of hourly, daily, weekly and monthly totals -- total sales … | |
![]() | Re: >> i think the the Include should be: >> #include <string.h> string.h is used in C programs. C++ should use cstring as the OP posted. He did it correctly. |
![]() | Re: >>cin >> sentence; there is nothing wrong with that while loop. The problem is the line above -- the extraction operator >> stops at the first space. use getline() instead. |
Re: maybe using an uninitialized pointer ? Can't say for sure until you post some code. | |
Re: >> status = fgets(list, 80, inp); fgets() does not return an integer -- it returns char*. And your loop is incorrect [code] while(fgets(list, 80, inp) != NULL); { // blabla }; [/code] >> fscanf(inp, "%d", &seconds); fscanf() is the wrong function because it redads from a file not from memory. … | |
Re: Is there a question somewhere ? Or do you just like to post code? | |
Re: do it just like you would from the command line. [code] system("dir > myfile.txt"); [/code] | |
Re: >>Yeah I'm using c style strings in c++ code get over it that is ok if you have not yet learned about std::string or your instructor requires character arrays. The function causes buss error probably because it does not return the stream. Your compiler should have given you either an … | |
Re: If you want someone to review your website, please post your request [URL="http://web.daniweb.com/techtalkforums/forum55.html"]here[/URL]. | |
Re: open the log file for append mode, not write mode, if you want just one log file that contains info for all files fopen(filename,"a"); or create a unique log file name if you want results in separate log files. | |
Re: It is continuing like that because cin is trying to convert the alpha character that is in the keyboard buffer to numeric, but it fails and leaves the key in the keyboard buffer. The easiest way to correct this is to get the integer as a string the convert the … | |
| |
Re: those functions sort double arrays, not int arrays. Either change your int arrays to double, or change the functions to sort int arrays. The two can not be mixed. >>double sortArray(double [], int); this is the wrong prototype. Actual function does not have those parameters. | |
Re: variable [b]size1[/b] must be set to the length of the input buffer, 1024 in your example. you might also initialize rgValue to 0 [code] char rgValue [1024] = {0}; [/code] | |
Re: there are a couple ways to approach the problem. (1) read the file twice. The first time through determine the number of columns in the 2d array from the "heading" line and the number of rows from the "value" line. Just keep track of the largest row and the largest … | |
Re: I hate snow -- don't like shoveling the stuff or driving in the stuff. It would not be so bad if the snow fell everywhere except on sidewalks and roads. So I moved south the St Louis missouri a few years ago where the winters are normally pretty mild. We … | |
Re: [QUOTE=niek_e;276823]Send me a link and I'll see what I can do p.s. You could download VS2005 pro yourself from microsoft.com, it's a 90 day trail[/QUOTE] The free express edition will not compile for wireless smart devices. | |
Re: given the example in [URL="http://www.nist.gov/dads/HTML/adjacencyListRep.html"]this[/URL] article and and the example you posted, where "->" represents a linked list, you would have a 2d linked list that looks like below ? 0->2->4 1->3->4 2->5 3->6 6->0 The first number in the pair is the row number, and the second number is … | |
Re: did you read [URL="http://msdn.microsoft.com/workshop/browser/webbrowser/browser_control_ovw_entry.asp"]this[/URL] tutorial | |
Re: pick any number and calculate it with pencil & paper. For example use 6 and 2. 6/2 = 3; --> (num/den) 3 * 2 = 6 --> ((num/den) * den) rem = 6 - 6 == 0 --> rem = num - ((num/den)*den); so 6 is a perfect number. now … | |
Re: >>provide the following member functions in your class: does your class contain all 9 required methods ? If not then you need to code them as described in the program requirements. Just start with #1 and code each one in order. You should also test each method after coding it … | |
Re: The destructor is not deallocating enough memory -- it heas a memory leak. For every new[] there must be a corresponding delete[]. You need to add a loop similar to the one that is in the constructor. As for your problem -- hummm I'll have to think about it awhile. … | |
Re: use getline when the file name may or may not contain spaces. [code] int readData() { std::string filename; cout << "Please enter in the path to the student score file: " << endl; getline(cin,filename); ifstream theFile(filename.c_str()); } [/code] | |
what is it supposed to do? I pressed it and it seems to do nothing except highlight the button. | |
Re: I suspect the problem is in the PHP code -- I don't know the first thing about PHP. But in C or C++ passing arrays is very common thing to do. Does php duplicate the array before passing it to c/c++ then toss it into the bit bucket after the … ![]() | |
Re: I think free [URL="http://www.crimsoneditor.com/"]Crimson editor [/URL]will colorize that FORTRAN code. But its only an IDE and not a compiler. You need to get a fortran compiler if you want to compile your programs into an executable file. But [URL="http://www.pgroup.com/gindex.htm"]here[/URL] is a plugin for Visual Studio 2005. | |
Re: since you did not post the exact code I dobt anyone can help you. I hope that is not really the way you declared class H. :eek: | |
Re: [QUOTE=Shiva_nan;276453]Is it possible to create reports using Dev C++?.. [/QUOTE] [URL="http://www.businessobjects.com/products/reporting/crystalreports/default.asp"]Here[/URL] you go. | |
Re: cabel $60.00 USD / month for 5 computers | |
Re: This question was already answered on [URL="http://www.programmersheaven.com/c/MsgBoard/read.asp?Board=3&MsgID=348929&Setting=A9999F0001"]another board[/URL] | |
Re: did you enter a number as argument to the program? Such as: c:>myprog 15 <Enter> [edit]sorry ~s.o.s.~ for duplicating your answer.[/edit] | |
Re: you will need a second char array. copy the first 43 characters to this second char array array then print it. then print the remainder of the original array. | |
Re: >> return a[count]; the above is inside the loop, so the loop only runs once. ![]() | |
Re: >>Release MinDependecy this means the compiler will use as many static libraries as possible when linking your program -- the program will make minimal use of DLLs. This makes it easy for you to run the program on other computers that may not have all the DLLs that the program … | |
Re: compile your program for debug then when the core file is created use debugger on it to see where the problem is. Suggestion: your program makes no input validations. How does it know that argv[1] contains an integer between 0 and 20? what happens if I enter 500 as argv[1] … | |
Re: If I remember my calculas correctly (mind you its been over 35 years), problem 1 is asking you to calculate the sum of all the numbers between 0 and some maximum value, that you will probably enter from the keyboard. If that is true, your program will need an integer … | |
Re: Check out [URL="http://www.codeproject.com/staticctrl/CFontStatic.asp"]this[/URL] MFC control:) | |
Re: >>Now, for a member function to be virtual in a class, both the base class AND derived class must be able to be instantiated Not really. The base class can have pure virtual functions which means it can not be instantiated on its own. The derived class(s) must override pure … | |
Re: you can't do that with any programming language. The best you can hope for is for a disassembler to produce assembly language. | |
Re: The link error is telling you that you forgot to code the function getData(). This is not a standard C function -- you have to write it yourself. | |
Re: this is obviously a c++ program so why don't you use a c++ container such as <map> to house the plugins? Other than that, its hard to say what your problem is because you did not post enough code. It would be helpful if you just zipped up all the … | |
Re: [code] for(y = 0; y < 80; y++) //#of employees could reach 80 { for(x =0; x <30; x++)//30 is a max length for names { fichier.getline (Noms[x], 50, ':'); [/code] 1. If 30 is the max length for names, why is getline() reading 50 characters? 2. The [b]for( x … |
The End.