15,300 Posted Topics
Re: >>All of the sudden my computer stopped playing music files That happened to me too awhile back. Foolish me! I had turned off the power to the speakers | |
Re: If you are using c++ why use character pointers? Just include <string> and use the std::string class becuse its much easier to use. All you need to do is define a class or structure with two objects: std::string word and int count.. Then you could create a <vector> of that … | |
Re: Welcome to DaniWeb. Sure wish you would create your own web site and post pictures of what you do there in the desert. I lived in Tucson for a few years during 1970s and whish I could go back. | |
Re: It is a lot more difficult in C language [URL="http://www.easysoft.com/developer/languages/c/odbc_tutorial.html"]see ODBC tutorials[/URL] | |
Re: or like this, where there is only one return statement [code] bool function(int a) { bool rvalue = false; if(a == 2) { // do something rvalue = true; } else { // do something else rvalue = false; } return rvalue; } [/code] | |
Re: You mean you want to sort the array without actually swapping array values? I have done that before but used a second array of intgers that represent the array indices. [code] float data[5] = {3,1,4,9,2}; int indices[5] = {0,1,2,3,4}; // sort the data for(int i = 0; i < 4; … | |
Re: I suppose the easiest way would be to use [URL="http://www.ibusy.com/articles/software-development/boost-html-library.html"]boost HTML parser[/URL] | |
Re: When main.cpp is compiled the compiler generated main.obj (or main.o depending on the os). When custom.cpp is compiled the compiler generated custom.obj. The linker uses both main.obj and custom.obj, as well as other libraries, to create the executable program. How does the linker know how to do that? It depends … | |
Re: what does struct date look like? >>fout.write((char *)(&m),sizeof(m)); you really should not write c++ classes to the file like that. classes which contains other c++ classes such as std::string, std::vector, c-pointers, etc, can not be written like that. It is safer and more portable from one run of the application … | |
Re: Which version of Visual Studio 2010 are you using? >>well first of all I ask u people don't try to give me advices like use QT instead that waste my time lot With a statement like that you are likely to not get any advice at all. | |
Re: arrays are always, always indexed beginning from 0, never 1. So line 38 should be [icode] for (int i=0;i<401;i++)[/icode]. The index values on lines 41 and 42 should be using the loop counter i, not the value of j that was read from the file. What would your program do … | |
Re: Think of a class as an entity all on its own -- the class has no knowledge of anything outside its class. It's not possible for a class to access objects declared elsewhere in the program. | |
Re: two things 1) what is the value of n before that loop starts? Uninitialized variable is the most likely reason the data is not being written to the file. Add [icode]n = 0;[/icode] on line 6 and see if that doesn't fix the problem. 2: The code is not writing … | |
Re: Oh you poor boy. It must be tough having to put up with sooo many holidays. :) | |
Re: >>error: glibtop.h: No such file or directory Either you don't have glib installed on your computer or you need to tell your compiler where to find it. >>Or to give me another idea like how to get info from /proc/cpuinfo Don't know, but someone else probably does. | |
Re: The first works ok because L converts a string literal from char* to wcar_t*. The second doesn't work because it is attempting to pass char* to a function that expects wchar_t*, and typecasting will ont convert that either. [URL="http://msdn.microsoft.com/en-us/library/ms235631(VS.80).aspx"]Read this article[/URL] | |
Re: The [b]extern[/b] keyword only tells the compiler that the variable will be declared later. It's common to declare variables using extern in header files. Then in one, and only one *.c file the variable(s) have to be declared again but without the extern keyword. The compiler does not complain about … | |
Re: Welcome to DaniWeb. Ohhh how I loved Tucson when I was there for three years during the 1970s. I hope the city is just as great now as it was then. | |
Re: That may be some compiler-specific extensions to the c++ standards. None of the compilers I know about allow that kind of constructs. | |
Re: Sounds like what you want are tutorials. There are lots of sites that have them, such as DaniWeb, and [URL="http://www.dreamincode.net/"]Dream.In.Code[/URL] As for practicing -- just do it on your own computer with your own compiler. Unless of course you don't have a computer of your own. | |
Re: You can also make SIZE char like this: [icode]char c = SIZE;[/icode] Or a double like this: [icode]double d = SIZE;[/icode] Or you can use defines to construct strings, as in this simple example. [code] #define SIZE 65 main() { char p[] = {SIZE,'p','p','l','e','\0'}; printf("%s\n", p); } [/code] | |
Re: Delete that do loop on line 152. Why would you want to continuously read the same file over, and over, and over forever??? change the loop starting on line 64 to this: [code] while( MySimpletron >> instructionRegister ) { memory[size] = instructionRegister; cout << setfill('0') << setw(4) << memory[size] << … | |
Re: That was a common problem with that compiler and the only fix is to reboot the computer. Unfortunately there is another common problem -- when you try to save a file the IDE thinks the file is already open by anothe program and can't save it. That can resut in … | |
Re: write a program that parses a *.cpp file and extracts all its symbols. Your program will have to recognize valid symbol names, which may be easier if the *.cpp file is formatted so that symbol names are surrounded by spaces [icode]int example = 0;[/icode] instead of this: [icode]int example=0;[/icode] | |
Re: you are seeing the difference between %s and %S (not the capitalization os s and S). with swprintf(): %s assumes the parameter is a wchar_t* %S assumes the prameter is char* The rule is just the opposite with sprintf() This illustrates the difference [code] int main() { wchar_t buf[255] = … | |
Re: what eactly do you mean by "using events"? c++ is not event driven. | |
Re: I don't think you can use that code to update a file on some other computer. You might have to use [URL="http://www.aspfree.com/c/a/.NET/Introduction-to-RPC-on-Windows-Part-I/"]Windows RPC[/URL] to accomplish that. | |
Re: download and use [URL="http://www.dependencywalker.com/"]this dependency walker [/URL]to find out what dlls and libraries your program needs | |
Re: Neither Fedora nor Ubuntu work correctly on 64-bit computers; I mean the os itself is ok but they have problems with sound and playing movies. Vista works great right out of the box with no tweaking needed. So my vote is for Windows. Never used a MAC so don't know … | |
Re: Depends on the operating system. MS-Windows use [URL="http://msdn.microsoft.com/en-us/library/ms632589(VS.85).aspx"]Windows Hooks.[/URL] | |
Re: >>Can a standalone programmer design large scale C++ projects? No because one person doesn't have the time to do it. It takes a team of people to design them so that the project gets the benefits of all their ideas and knowledge. I know Windows Word and the Windows operating … | |
Re: 1. Read a line from the text file 2. Break the line apart using strtok() or some other method to put each field into its own variable. 3. Write the SQL INSERT or UPDATE statement 4. Execute the statement in #3 above 5. Make whatever checks you want on the … | |
Re: Sleep() only works for the current thread, it does not affect other threads. So if you think other threads are also sleeping then you are doing something wrong or you do not understand the code you wrote. If you put that same Sleep() at the same place in the code … | |
Re: Don't post something just becaue you might think it might be useful to someone some day. I was going to answer the question, but now I'm glad I didn't wast my time on it. | |
Re: Did you set up event handling functions for the controls that are on the form being passed in? If not then you need to do that because that is what makes the controls do things. | |
Re: Please ask specific questions -- doesn't it compile? If not, why? Doesn't it work right? No, then what is wrong with it. | |
Re: 1. move line 20 so that it increments i after line 22. 2. line 31: There is no need for that j loop. Just make the tests for minimum and maximum within the i loop that starts on line 19. Every time a new number of entered check of the … | |
Re: are you asking for a program that will send out spam text messages ? If so I doubt you will find it on DaniWeb. | |
Re: [URL="http://sourceware.org/pthreads-win32/"]Link[/URL] | |
Re: >>I have tried to tokenize the whole file Post what you have tried. >>getline cant have delimiters in it. [code] std::string word; ifstream in("filename.txt"); while( getline(in,word,',') ) { do something with this token } [/code] | |
Re: Read through the threads on this forum and you will find hundreds of programs you can code. | |
Re: did you see [URL="http://www.youtube.com/watch?v=WsxSIDxLE4M"]this video tutorial[/URL]? | |
Re: >>do I have to redraw everything? Yes, well maybe. >>if so, which controls should I include (at WndProc?) catch the [URL="http://msdn.microsoft.com/en-us/library/dd145213(VS.85).aspx"]WM_PAINT event[/URL]. | |
Re: >> How do I edit my profile? Click the CONTROL PANEL link at the very top right corner of the page. It's just above the SEARCH edit box. | |
Re: Read [URL="http://www.cplusplus.com/reference/clibrary/cmath/pow/"]this link[/URL] and you will see that none of the overloaded functions take two integers. | |
Re: did you declare variable CStr? [icode]CString Cstr;[/icode] Instead of that loop, just try this: [icode]CSt = str.c_str();[/icode] assuming CStr is of type CString. | |
Re: You need to read a tutorial or book about how to write for loops. The for loop has three parts 1. The sttement that initializes the loop counter and/or other variables 2. The test for a condition which will terminate the loop. 3. Increment or decrement the loop counter Any … | |
Re: GetWindowText() returns an int, which can not be typecast to char* or LPCTSTR. Read all about that function [URL="http://msdn.microsoft.com/en-us/library/ms633520(VS.85).aspx"]here[/URL] instead of just blindly tossing code at your compiler and expecting things to work. |
The End.