15,300 Posted Topics
Re: [QUOTE=Narue;1151242][B]>i want to give a presention on functions use in code[/B] [B]>can any one help me ,as give me these codes?[/B] Wait. You're giving a presentation on something that you don't even know how to do?[/QUOTE] Is that so uncommon? The idea is for him to learn how to do … | |
Re: blobs are nothing more or less than large chunks of binary data. The database knows nothing about the blob's contents, its up to your program to interpret that. [URL="http://www.developer.com/net/asp/article.php/3761486/Working-with-Binary-Large-Objects-BLOBs-Using-SQL-Server-and-ADONET.htm"]Here [/URL]is one article that may help you. | |
Re: [URL="http://lmgtfy.com/?q=how+to+install+windows+fonts"]Google will help you out.[/URL] | |
Re: [QUOTE=Kikazaru;1149127]Thanks for the quick responses. What I'm really wondering is whether giving the const qualifier really does facilitate any compiler optimizations (in the case of a variable which is local to a function and only assigned upon initialization). [/quote] Read Necrolin's post. [QUOTE=Kikazaru;1149127]-I'm wondering if hunting down and clarifying all … | |
Re: [URL="http://lmgtfy.com/?q=socket+programming+tutorial"]google will show you lots of information and tutorials[/URL] | |
Re: It sounds like a math problem not a programming problem (combination theory). How many combinations are there in N values taken two at a time? If there were just 2 points, X and Y, there would be just one line. Given 3 points, X, Y, and Z, there would be … | |
| |
Re: >>Base * ReturnPtrToANewBaseClassObject() In base.cpp you forgot to add the Base:: class scope [icode]Base * Base::ReturnPtrToANewBaseClassObject()[/icode] | |
Re: >>Will this do the job? Don't know -- why don't you compile and test it to see if it will work correctly. add a print statement on every insertion to see if the array was shifted correctly. | |
Re: Oh well, win some, lose some. Congratulations to Canada for that win. But we still have more medals than they do. | |
Re: An array of 22 2x2 arrays is declared [icode]char matrix[22][2][2];[/icode] | |
Re: 0 seconds is probably correct. Computers will execute that code in just a few nanoseconds. Call clock() instead of time() because clock() has higher resolution. But that too may result in 0. If it does, then call that Multiply function several hundred times and take the average time. [code] clock_t … | |
Re: It will depend on what operating system you are using. [URL="http://winprog.org/tutorial/"]This[/URL] is a pretty standard tutorial for MS-Windows. | |
Re: read the file one word at a time and compare each word read with the string. you can use fstream's extract operator >> to do that [code] std::string word; std::fstream in("filename"); // read one word in >> word; // now compare [/code] | |
Re: >>for (int index =0; index < size * 2; index++) Delete that line. | |
Re: So what do you need help with? We are not going to write that program for you, so you might as well get started. | |
Re: I'm trying to recall from some work I did 15 years ago. Seem to remember that all you do is xmit a single byte that contains the bit pattern you need. But then again, maybe not. SetCommStat() might do it for you. | |
Re: See [URL="http://www.daniweb.com/code/snippet216612.html"]this code snippet [/URL]I posted here about 5 years ago. | |
Re: The comparison function is comparing addresses, not the values that are in the structures [code] int indirectstructsortbyid(const void *i1, const void *i2) { struct mys **a = (struct mys **)i1; struct mys **b = (struct mys **)i2; return (*b)->id - (*a)->id; } [/code] [edit]^^ Adak beat me to it.[/edit] | |
Re: My guess is that you are including MyClass.ini on two or more *.cpp files. objects can not be declared in header files because it causes the multiple declaration link errors that you have. Suggest you do not use MyClass.ini at all. Instead, put the initialization in one, and only one, … | |
Re: When line 2 failes that function should return right away instead of processing the rest of that function. | |
Re: strstr() is used to find a string within another string. For example, it would check if "World" is contained in the string "Hello World". strstr() is not related to structures or typedef struct. | |
Re: It will depend on the operating system and compiler you are using. | |
Re: main() is passing integers, but the va on line 27 is trying to get floats. Change main() to pass floats. [icode] Function1(3, 1.0F, 2.0F, 3.0F);[/icode] | |
Re: In c++ [code] #include <iostream> #include <algorithm> #include <string> using namespace std; int main() { string str = "How now brown cow."; transform(str.begin(),str.end(),str.begin(),toupper); cout << str; return 0; } [/code] | |
Re: Memory for all types of static variables is allocated when the program is compiled, just the same as when memory is allocated to normal global variables. When your compiler creates the executable program that program includes memory for all the functions that you wrote (or linked with in libraries) as … | |
Re: The first parameter is a two dimenaional array of characters, declared something like this: [icode]char grid[20][MAX_Y];[/icode]. The second parameter is a single Line object passed by reference. [code] char grid[5][MAX_Y]; Line line; drawLineInGrid(grid,line) [/code] I assume you need to initialize the grid with some values before calling that function. | |
Re: That's why you should write and debug such programs in small sections. I suppose you are using *nix, so learn to use a debugger such as dbg, which will pinpoint the seg fault for you by using the core file. The program first has to be compiled for debug -- … | |
Re: [URL="http://lmgtfy.com/?q=c%2B%2B+friend+functions"]google is your programming buddy.[/URL] | |
Re: You may have physically placed the libraries in those directories, but did you tell your compiler that it needs to look for those libraries ? I don't use Borland compilers so I don't know how to do that. Maybe in project setting somewhere. | |
Re: [URL="http://www.fnord.ca/articles/xml.html"]see boost library[/URL] | |
Re: I wouldn't make duplicates of A and B, but put the results in matrix C so that A and B are left unchanged. | |
Re: how did you write the gui? win32 api, MFC, wxWindows or something else? And is the serial port code in the same or different thread than the gui? | |
Re: The scope operator is c++, not C. In C give the variables different names so that you, and the compiler don't get confused. | |
Re: combine the loops on lines 31 and 37 because there should only be one loop, not two. [code] while( infile >> lname >> fname >> midInitial ) { file2 = fname + lname + ".dat"; ifstream in(file2.c_str()); if( in.is_open()) { while( in >> ton ) { // do stuff here … | |
Re: [URL="http://www.daniweb.com/forums/thread70096.html"]You must have missed this thread.[/URL] | |
Re: Suggest you [URL="http://lmgtfy.com/?q=DBus"]start here[/URL]. | |
Re: [icode]if( windspeed >= -40 && windspeed <= 40) [/icode] When working with negative numbers the operation is the reverse of positive numbers. That is, -50 is less than, not greater than, -40. | |
Re: [URL="http://www.google.com/search?client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&channel=s&hl=en&source=hp&q=database++c%2B%2B+.net&btnG=Google+Search"]Read some of these links[/URL] | |
Re: lines 81 and 84. I see no object named "addressbook". There is of course a structure by that name, but no object. Create an object of that type, (don't use the same name as the structure to prevent confusion) | |
Re: wrong compiler. Use either Code::Blocks or VC++ 2008 Express (both are free) so that the program can take advantage of up to 2 gig RAM and huge data files. The compiler you want to use can't either of those. You will also learn how to write a modern c++ program … | |
Re: Of course. Since myfile is ofstream it is not necessary to specify ios::out because that's what ofstream does anyway. [code] name += ".sta"; myfile.open(name.c_str()); [/code] | |
Re: If the reference (e.g. int*& thingy;) was actually allocated somewhere else then your class destructor should not do anything with it. Let whatever created it destroy it. | |
Re: You sould completly replace cmd.exe with your own version of that program. For example Microsoft has already done it with [URL="http://pauledlund.spaces.live.com/blog/cns!70265AE7CABD0249!380.entry"]PowerShell[/URL]. Another example [URL="http://www.computerhope.com/forum/index.php?topic=77629.0"]here[/URL] | |
Re: The >> operator stops at the first space, so if you enter "John Doe" as the name the cin will put John in name and Doe in Address. Change the >> operator to getline [icode]getline(cin, name);[/icode] | |
Re: [QUOTE=Tango2010;1144973]hi, using this methodology, is there a piece of code I could write if after where a folder in directory is detected to scan all files in that folder and then return to the root folder to continue? Many thanks[/QUOTE] Use recursion. There are some examples of that in the … | |
Re: reading files is the same in console and gui programs. The difference between C and C++ is that C++ will use fstream and C will use FILE*. There are many tutorials and code snippets that will show you how to read a file using FILE*. [URL="http://www.google.com/search?client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&channel=s&hl=en&source=hp&q=how+to+read+a+file+in+c+language&btnG=Google+Search"]Here is a google list.[/URL] | |
Re: You can open any file with FILE*. It doesn't matter what the extension is. [icode]FILE* fp = fopen("name.html","r");[/icode] | |
Re: line 59: What will that function do if the parameter Dictionary object gets destroyed?? A: All those pointers will become invalid. It is better if the [b]this[/b] object creates its own copy of the Index array so that it will own all the memory instead of relying on the memory … | |
Re: 1) include stdlib.h and use _MAX_PATH macro to declare the size of the source and destination buffers. On MS-Windows its value is 260. In c++ programs it will be better to use std::string variables instead of char arrays. If you do that then you don't need stdlib.h. line 21: The … |
The End.