15,300 Posted Topics
Re: [QUOTE=swathydoss;1117778]hi....... i want a program in c based on any data structures with de code.plz............it shd be catchy n can be based on reality[/QUOTE] And you should learn how to write proper English instead of that baby googoo gaagaa talk. That's what's wrong with kids these days -- cell phones … | |
Re: This is your lucky day -- I gave you positive instead of negative rep for bumping a 4-year-old thread If you only read one byte into a 4-byte integer that would make the integer not worth shit. You can't do it like that (at least so that it will produce … | |
Re: vc++ 2008 Express produces a runtime error on that [icode]delete ptr;[/icode] line because the class instance was already deleted. I've seen a few class objects delete themselves -- such as Microsoft's COM functions. | |
Re: There is no difference because C compiler normally ignore spaces. You can code it either way unless your instructor (assuming you are a student) or other coding standards say otherwised. | |
Re: Most of us can probably do that, but we are not in your classroom. Post whatever you have done to solve that problem and ask questions. The first things you need to do is [b]listen[/b] in class (assuming you attended class at all), then [b]study[/b] your textbook. | |
Re: See the win32 api function GetOpenFileName() [URL="http://www.codeguru.com/forum/showthread.php?t=392963"]here[/URL] and [URL="http://msdn.microsoft.com/en-us/library/ms646927%28VS.85%29.aspx"]here[/URL]. | |
Re: what version of Windows are you running? Unregister that ActiveX control and try to open the file again. If it works then there is probably something wrong with that ActiveX control. | |
Re: >>in your case a query like site:[url]www.daniweb.com[/url] "free online television" Hum ... never new we could do that :) | |
Re: If you have a 64-bit computer than you will want to download the 64-bit version of *nix. But be warned that 64-bit is not well supported, that is you might have problems getting some 64-bit device drivers and programs. I never had problems with the os itself, just device drivers … | |
Re: Just like C and C++ you have to prototype the functions that you want to call. That function "rad" does not appear anywhere in that file except the call statement. | |
Re: You can't call any MS-Windows programs (such as Notepad.exe) from a 16-bit compiler because the compiler doesn't know how to do that. | |
Re: I suppose one way to do it would be to create an array of 101 characters, each array element represents the numeric grade. The use the grade to index into that array. For example [code] char grades[101] = {0}; grades[100] = grades[99] = grades[98] = grades[97] = grades[96] = grades[95] … | |
Re: I'm sure you all worked very hard to write those little programs but I think they are quite useless to anyone without lots of comments that explain what the programs are doing. No one is going to wade through all that uncommented code and try to figure it out for … | |
Re: Most programs will use the Microsoft Treeview Control. [URL="http://www.codeguru.com/cpp/controls/treeview/classes/article.php/c13167/"]Here is some sample code[/URL]. The treeview control generates an OnClick event and one of its parameters is the node that was clicked. | |
Re: CFree uses MinGW compiler, which is a 32-bit compiler. Therefore you can not use graphics.h or its library with that compiler. As for OpenGL, just install it on your computer then set up CFree to use it. I have never used CFree, but from its home page and description it … | |
Re: >>Is there a way through which i can clear all the inputs at the end of loop.. [code] while( kbhit() ) getche(); [/code] | |
Re: If you want a list of all the files on your he you don't need the \ character at all. Just this: [icode]system("dir c: /s > c.txt");[/icode] | |
Re: You are assuming everyone knows that SHOP, BFS, and TLE mean. We don't. You might get more help if you would provide links to that. Also, that appears to be a C program, not C++. | |
Re: Use the modular operator, which will return a value between 0 and maxNumber. [icode]int x = rand() % maxNumber;[/icode] | |
Re: Depends on the operating system. But [URL="http://winprog.org/tutorial/"]here is a tutorial [/URL]for MS-Windows. There are easier ways to create GUI windows. One of them is C#, while another is using c++/CLR and VB.NET. c++ is not a good language for that purpose although it can be done quite successfully (and a … | |
Re: If this is part of a c++ class then make those two variables members of the class. If not, then you can declare them in main() and pass them around to the functions that use them. In the case of the function you posted, you will have to pass them … | |
Re: If all you want to share is a header file and *.cpp file then I wouldn't bother making a DLL because that is like killing a fly with a sludgehammer. Instead, just create a static library project and add those two files to it. Then in each of the application … | |
Re: The problem is that you did not clear out the destination buffer when you declared it [code] char str[20] = {0}; char enc[20] = {0}; [/code] | |
Re: You can use c++ [URL="http://www.cplusplus.com/reference/algorithm/random_shuffle/"]ramdom_shuffle[/URL]() to scrample the names. I have not used it myself so can't tell you how to do it. The rest of that program should be pretty straight forward. | |
Re: Delete it and install a better compiler such as Code::Blocks or VC++ 2008 Express. I know they both work ok. | |
Re: assert() only shows something when the program is compiled for debug. If compiled for release assert() does nothing. In your example it is better to test for [icode]inFile.is_open()[/icode], which works in both debug and release mode compiles. [code] int main() { ifstream inFile; ofstream outFile; inFile.open("file.txt"); if( !inFile.is_open() ) { … | |
Re: What are the problems with that program? You don't take your car to an auto shop and tell them "My car is broke, please fix it" :) You have to at least tell them what the problem is. | |
Re: I think you might be talking about an array of pointers to some objects, and the pointers are NULL if it does not contain valid pointer. Something like this: [code] class MyClass { // blabla }; // an array of 10 pointers to MyClass objects, // initialized to NULL pointers. … | |
Re: >>undefined reference to `cAccount::cAccount()' That means you defined a constructor in the class but never coded the implementation function. | |
Re: [QUOTE=sadhramani;1117815]char *mon; mon is a character pointer variable. Is there any problem with the declaration?[/QUOTE] strncpy() does not allocate memory for the destination address, that has to be done by the calling function. So you might want to declare it like this: [icode]char mon[255] = {0};[/icode]. That allocated enough memory … | |
Re: >>Plants plant1(); When declaring an object do not include the (). Its just [icode]Plants plant1;[/icode] | |
Re: I've toyed around with that some time ago too, trying to see what happens when main is declared to return char*. My compiler just returned the address of the string, which is an integer. Similar with [icode]void main()[/icode]. In this case the compiler produced code to return whatever value was … | |
Re: Its very possible that on line 25 the value of size will be 0. new can handle that ok but will return a pointer to a zero length string and line 25 will trash memory when that happens. >>//inserts b inside a from index m to n I don't think … | |
Re: I agree its stupid thing to do, unless of course the wrapper function does other things too. | |
Re: The only thing about VC++ 2008 that I do not like (same with version 6.0) is those blasted docking windows. Every once in awhile I accidently undock a window and have a real hard time putting it back into position. | |
Re: If you are using VC++ 2008 or Code::Blocks those IDEs will generate some of the DLL code for you. Then all you have to do is add the functions you want, declare then with __dllexport (or add the function name to a *.def file). You can even export entire c++ … | |
Re: Yes of course its possible. How to do it will depend on the file's format. Not all images are equal. [URL="http://lmgtfy.com/?q=image+file+format"]Here are some links [/URL]for you to research. | |
Re: You will want to use a two-dimensional array for that -- the first dimension is the distance and the second dimension indicates whether there is a car in that spot or not. So you will want to declare the array something like this: [code] const int MaxParkingSpaces = 10; int … | |
I have Win7 and using FF with Logitech wireless keyboard and mouse. The problem is that the mouse wheel stopped working (it won't scroll the window any more, or just scrolls intermittently for very short periods of time) but everything else works as expected. Changed the battery but that did … | |
Re: 1) it will depend on how you created the array. If you use <vector> then you don't have to do anything special because it will auto expand as you add data. But if you use something like [icode]int* array = new int[25];[/icode] then you have to first allocate a new … | |
Re: See functions in time.h -- particularly mktime() and structure time_t. Also it's not called "forcasting time" -- that is not forcasting anything. Its just simply advancing to some future date. | |
| |
Re: You might have to make a few minor changes to your program, depending on how you coded it. For example [code] for(int i = 0; i < something; i++) cout << "Hello\n"; if( i > 10) // blabla [/code] VC++ 6.0 will allow the above code but c++ standards and … | |
Re: name_t on line 16 overrides the name_t typedef on line 10. Bad idea. line 15 could be declared as simply [icode]char space = ' ';[/icode]. No need for the array syntax. I fail to see why you need first_name to be a two dimensional array of 255 characters each dimension! … | |
Re: Get either Code::Blocks with MinGW compiler or VC++ 2008 Express, both are free. Which to use might depend on what compiler your university has. | |
| |
Re: Sorry but that is not a quine program (see [URL="http://en.wikipedia.org/wiki/Quine_%28computing%29"]this link[/URL]). [quote]A quine takes no input. Allowing input would permit the source code to be fed to the program via the keyboard, opening the source file of the program, and similar mechanisms.[/quote] | |
Re: Turn off UNICODE -- goto Project --> Properties (the last menu item) -->Configuration Properties --> General. Now on the right side, the third item from the bottom is "Character Set". Change that setting to "Not Set" You could have turned off precompiled headers in a similar way, except under Configuration … | |
Re: line 91: use [ and ] instead of ( and ) | |
Re: I got it to compile with VC++ 2008 Express with only a couple minor changes. A couple obversations: 1) line 45: [b]code[/b] should be declared as int, not char because the scanf() on line 58 expects a pointer to an int. 2) delete all lines that call fflush(stdin) because fflush() … |
The End.