15,300 Posted Topics
Re: you need an opening brace { between lines 53 and 54 (or at the end of line 53 if that is your coding style) and remove the semicolon at the end of line 58. lines 78, 81 and 85. [b]values[/b] is a 2d array of doubles and you are attempting … | |
Re: To check a password on MS-Windows os all you have to do is attempt to log in with the user name and password -- there are win32 api functions that allow programs to do that, assuming it has appropriate permissions first. | |
Re: Fred Thompson for President :icon_lol: :icon_lol: :icon_lol: :icon_lol: :icon_lol: :icon_lol: :icon_lol: :icon_lol: :icon_lol: :icon_lol: :icon_lol: :icon_lol: :icon_lol: :icon_lol: :scared: He did make a good da on Law & Order. Much better actor than Ronald R. was, but not even close to being the same kind of politician. | |
Re: >>Is there any need to escape a Registry Key path when reading it from a file No -- escape characters are only useful for string literals which are interpreted by the compiler at compile time. | |
Re: And don't forget to close the file < CloseFile() > before leaving that function! | |
Re: When writing MS-Windows programs I always used CreateThread() because it seemd to be simpler. There are several pitfalls with threads -- specifically you have to snychronize the use of variable and code that are commen to all threads. For example suppose you have a global variable that is set by … | |
Re: One thing that may cause that behavior is if the two functions are in different program units (*.c files) or libraries and compiled with different packing factors. Another cause is two functions in different program units using different versions of the same structure. Check your computer's file system to see … | |
Re: I don't think its undefined behavior, just bad coding. In function wow() x and z both are references to the same object, so any changes to x is also reflected in z. After line 7 is executed the value of both x and z is 1. After line 9 is … | |
| |
Re: [QUOTE=MidiMagic;419668]- Why do most spreadsheets and programming languages do trigonometric functions in radians, when most people use degrees?[/quote] For the same reason Americans use Imperial system of measurememt while most europeans use the metric system. Just because. [QUOTE=MidiMagic;419668]- - Why do most of the C-based languages (including Java, JavaScript, and … | |
Re: The only two I have worked with are manufactured by [URL="http://www.symbol.com/products/mobile-computers"]Symbol Technologies[/URL] and [URL="http://www.intermec.com/products/computers/handheld_computers/index.aspx"]Intermec.[/URL] Both cost several hundred $$$. | |
Re: what you need is a 2-dimensional array of integers with 10 columns and a dynamically expandable number of rows to hold the scores. [URL="http://www.taranets.com/cgi/ts/1.37/ts.ws.pl?w=329;b=286"]Here[/URL] is some more information about this: After you understand multiple-dimensional arrays and how to allocate them then you will be ready to read the data into … | |
Re: >>Here's a sample, but I don't understand And neither does anyone else here. That function is specific to the database library you are using, which you failed to identify. You need to read the documentation written by whoever wrote that function. A more general way of accomplishing it is to … | |
Re: yes, use standard C functions in stdio.h such as fopen(), fseek(), fread() and fwrite() or c++ functions in fstream. They are a lot more portable too. | |
Re: by tooltips do you mean the thread preview that follows the cursor around on the menu page ? Yes I don't like that either and find it not at all useful when there is more than 1 post in the thread. Its just annoying. | |
Re: >>can anybody help me to write the following program Yes someone here will [b]help[/b] you but you first have to post your code and ask questions about what you don't understand. We will not write the program for you. | |
Re: Also, Dani changed the rules a couple weeks ago and removed all rep that was given in Geeks Lounge. Many Members lost dots. | |
Re: win32 api [URL="http://msdn2.microsoft.com/en-us/library/ms724942.aspx"]SetSystemTime()[/URL] One problem with your program is that many computers automatically synchronize the system time with something else, such as a network computer or a satellite. In that case whatever you set the computer to will eventually be changed. >> can't set the time during run time why … | |
Just finished installing this linux-like os and had to post a message. Its kind of nice os, open source and free of course. It all fits on one CD and has several packages that can be added after installation. Its truly an os-for-dummies, It was even easier to install then … | |
Re: what are the errors. maybe you need to add braces { and } around lines 21, 22 and 23 to make them all part of the loop. | |
Re: lines 13 and 14 are incorrect. Should be this: [code] printf("using &num= %p\n", &num); [/code] Your line 14 will probably cause access violation because printf() assums the first parameter is an ascii null-terminated string, and passing a pointer to a variable is not that kind of thingy. [edit] ^^^ what … | |
Re: vector does all the dynmaic allocation for you -- just call its push_back() method to add a new row. [code] string line; vector<string> array; ... // now put this inside the file read loop just after getline() array.push_back(line); [/code] | |
Re: searching a file for a specific string is fairly straight forward. Open the file, read each line and search the lines for desired string. use std::ifstream object for the file, getline() to read each line into a std::string object, the use the string's find() method to see if it contains … | |
Re: If you use win32 api functions there is an edit control that does most of that for you. You just have to implement the File and other menu items. | |
Re: There are win32 api functions that let you change the shape of the cursor, but to change its speed and other configurations use the control panel. | |
Re: when using 32-bit programs you have to forget about what you learned with old 16-bit compilers. It ain't gona work. They don't support anything in graphics.h or dos.h. You will probably have to do a 90% rewrite of that program you want to compile. If you want to do ms-windows … | |
| |
Re: [QUOTE=MidiMagic;416412]Not simple. The code tags are messing up the code indenting when I do that. I then have to edit again to fix that. [/QUOTE] My guess is that you are using tab characters as well as spaces. All editors screw up the code when you mix tabs and spaces … | |
Re: [offtopic]Hey Dani -- is that a new kind of tag ? [ search ] This is the first time I've seen it used. Really neat :) [/offtopic] | |
![]() | Re: line 187: you forgot the parentheses after the function name. Same with all other functions, so I won't tell you the line numbers. >>I don't know how to declare the funtions before it reach the int main? Pretty easy -- just copy the line with the function name to somewhere … |
Re: compile it on MS-Windows with a compiler that supports MS-Windows or use a cross compiler on *nix that generates MS-Windows file format executables. Just simply renaming the file is not sufficient. | |
Re: instead of the dot operator use pointer operator [code] myClient->call(serverUrl, methodName, "ii", &result, 5, 7); [/code] But make sure the pointer is a valid pointer -- it has to be initialized to something before the above line can be successfully executed. [code] myClient = new xmlrpc_c::clientSimple; [/code] | |
Re: One explaination of threads is [URL="http://www.codeproject.com/threads/crtmultithreading.asp"]here.[/URL]. Exactly how to apply it to your program depends on what you want the threads to do. | |
Re: search [url]www.codeproject.com[/url] -- they have a couple dozen example mfc programs. You should put your initialization code in the OnInitDialog() function, which gets called by DoModal(). And you may have to subclass the CEdit control. | |
Re: >>destNo = sourceNo<<n; // Here n is the number of bits you want to skip. Here, the value of n is undefined because you didn't initialize it to anything in the previous line :) | |
Re: I don't like catsup on either eggs or fries but I know a lot of other people that do. The only thing that goes on an egg is a muffin. | |
Re: unfortunately there is really nothing you can do about it except to use a 64-bit integer, such as long long or _int64. What you are experiencing is data overflow -- integers can only hold a finite number of digits. The file limits.h contains macros that are the maximum values for … ![]() | |
Re: post code and an actual example string. For example: "a b c" replaced by "abc". If that's what you want to do when code a while loop something like this: [code] string::size_t pos; while( (pos = mystring.find(' ')) != string::npos) { mystring = mystring.substr(0,pos) + mystring.substr(pos+1); } [/code] | |
Re: [URL="http://www.daniweb.com/forums/thread6542.html"]Here[/URL] is a short ifstream tutorial. Its a little old, so replace [b]fstream.h[/b] with [b]fstream[/b] because current c++ standards have dropped the [b].h[/b] file extension. | |
Re: [QUOTE=joshSCH;422949]Hello, Sanjay! Welcome! :D[/QUOTE] Better a year late than never :ooh: I think everybody knows this DaniWeb Icon by now. ![]() | |
Re: you need to be a little more specific -- monitor error code occurrences about what? delete instances of what in what DB? Your description is way too brief to be of much value. | |
Re: The next bug is at line 15 -- feof() doesn't work the way you think. Instead, you should code it like this (which will only work with text files. binary files are coded differently because the EOF character could be a valid character in the file.): [code] while( (ch=fgetc(fp)) != … | |
Re: [QUOTE=Infarction;422364]They'll probably tell you to never use goto as well, but that doesn't mean you should just listen to them. Find out why, and then do what is best; and yes, the popular opinion can be wrong sometimes..[/QUOTE] Most, if not all, professional programmers refuse to use the [b]goto[/b] statement, … | |
Re: search the array backwards -- go to the end of the array and search to the beginning by decrementing the loop counter. | |
Re: Lets see if I have this straight: get input from keyboard on computer #1 and send it via serial port to the keyboard buffer on computer #2. Yes that is certainly possible and will require you to write two different programs -- one for each computer. | |
Re: [QUOTE=Salem;423164]@OP If you're into deep problems, perhaps a career in oceanography would be to your liking ;)[/QUOTE] or one in deep space abord the Startrek Voyager :) | |
Re: I'm retired now and on Social Security. Yea -- you young working or soon-to-be-working Americans can support me now for the rest of my life just as I supported my elders over the past 45 years. But I keep myself busy working part time at Wal-Mart (all old retires work … | |
Re: Or [URL="http://www.sgi.com/tech/stl/List.html"]here[/URL] |
The End.