15,300 Posted Topics
Re: >>The starting address of any element in the account array can then be calculated as the address of the first record in the array + (account number - 1000) * sizeof(int). Are you certain about that statement ? That would imply that all those account number integers are contained in … | |
I hope everyone has a great newyear's party tonight. I just got a glimpse on TV of the New Year fireworks display that Austrilia put on. Wow! It was a glorious display. We usually have similar displays all over the USA. When I was a kid in 1950s we used … | |
Re: >>cant detect well the problem.. Neither can we since we can't see your computer's monitor and code. | |
Re: [URL="http://www.tech-archive.net/Archive/VisualStudio/microsoft.public.vsnet.debugging/2008-01/msg00009.html"]Here [/URL]is some info that may be helpful to you | |
Re: you could do a remote login on the remote computer, assuming you have a user name and password on that machine. I've seen this done by network administrators at my old office, but I don't know exactly how they did it. I suppose another way is to use PCAnywhere by … | |
![]() | Re: With the MSDN subscription you gets 40-50 DVDs (or so) that contain every operating system Microsoft has ever released and in every language (English, German, etc) as well as C++ compilers, device drivers, DDK, Windows SDK and searchable documentation for all win32 api functions. |
Re: >>error C2679: binary '>>' : no operator found which takes a right-hand operand of type >>'std::string' (or there is no acceptable conversion) you forgot to include <string> line 30 of the code you posted: the iterator [b]iter[/b] has never been set to anything, so that loop won't work right. | |
Re: Welcome to DaniWeb -- I hope you read the RULES which state we do not do your homework for you. Show us what you know how to do and we'll help with the rest | |
Re: Neither of those functions will be useful to you. This is a c++ program, right? Then just use std::string's find() method after reading a line from the file [URL="http://www.cppreference.com/cppstring/index.html"]Here [/URL]is a complet list of std::string methods. [code] #include <string> #include <fstream> using namespace std; int main() { string line = … | |
Re: add [icode]cin.ignore()[/icode] just before the return statement to make it stop until you press a key. | |
Re: line 13: If that is executed the next line should be exit(1) to prevent further program processing. No point continuing when the input file doesn't exist. lines 26 and 40: delete both these, only one is needed. See the while loop I posted below for correction. linet 25: don't use … | |
Re: >>complete abolishment of religion in government Yes, I agree with that. There should be a wall between government and religion -- one should not cross the boundries of the other. The government should stay out of the church's business and the church should stay out of politics. Times have changed … | |
Re: goto [url]www.amazon.com[/url] and search for "Visual Studio 2008" in the books selection. They have several of them with reader reviews too. If there are any graphics books they will have them too. | |
Re: by WMI I assume you mean [URL="http://www.microsoft.com/whdc/system/pnppwr/wmi/default.mspx"]this[/URL] ? Read the article and it will tell you what you need. | |
Re: The functions you call are probably attempting to access that memory location because of bad arguments you send it. Check the value of pointers such as [b]p_dx_Device[/b] to make sure they are valid and the value of the parameters sent to make sure they are correct. for example what is … | |
Re: I think you get a couple rep points for every 1,000 posts. As far as I know there are no rep points based on length of membership. Post frequently in the technical forums and your rep points will probably go up faster. | |
Re: [QUOTE=tamereth;520100]My program works properly under windows, however, it seg faults when I try to compile/run it under linux. [/QUOTE] So, how did you get the executable program when there were compile erorrs? No respectable compiler produces the executable under that condition. Do you not look at the messages your compiler … | |
Re: You can boot from any bootable drive -- master, slave, CD, or DVD, and in some cases even the A and B floppy drives. But the first hard drive installed is always the master driver. All other non-removable hard drives are slave drives. You might damage your computer if you … | |
Re: [QUOTE=twomers;519216]House.[/QUOTE] House isn't a sitcom. My varorite sitcom from UK is Ivory Towers, although Red Dwarf was very good too. From USA is I Love Lucy and The Jeffersons. I don't like any of the current ones. | |
Re: line 24: Performance can be improved as shown below. The outer loop goes from 0 to number-of-elsmenets -1, its not necessary to look at the last item. The inner loop starts at i+1 and continues to the number of elements. [code] for(int i = 0; i < 9; ++i) { … | |
Re: [b]name[/b] is just a single character. What you want is a character array. [icode]char name[255];[/icode] | |
Re: >>We don't do it for you. Period. Not so fast Nurue. I'll do it is the op first deposits $10,000 USD into my PayPal account. But then this thread will have to be moved to the Job Offers board. :) | |
Re: The other file you need to write is the *.cpp file that implements the functions in that class, and main() which all standard C and C++ programs have to have. When you created that Dev-C++ project it already created the main.cpp and main() function shell. So now all you have … | |
Re: The default to open() is to truncate the existing file and start anew. To append to the file add the ios::app flag. [icode]myfile.open ("example2.txt", ios::app);[/icode] [URL="http://www.cplusplus.com/reference/iostream/fstream/open.html"]Read this [/URL]for a complete list of the flags you can use in open() | |
Re: Several ways to achieve that. Read [URL="http://www.alexfedotov.com/articles/enumproc.asp"]this article[/URL] | |
Re: do mean VC++ 2008 Express? All C++ compilers support command-line interfaces, its part of the c++ ISO standards. [icode]int main(int argc, char* argv[])[/icode] In the above line, [b]argc[/b] is the number of command-line arguments and [b]argv[/b] is an array of the arguments. | |
Re: It is easier to use std::stringstream class to do that [code] #include <sstream> <other includes here> ... string sentence = "Once upon a time there were three little pigs"; string word; vector<string> array; stringstream stream(sentence); while( stream >> word) { array.push_back(word); } [/code] | |
Re: see these [URL="http://www.google.com/search?hl=en&q=winsock+tutorial"]winsock tutorials[/URL]. MFC has a socket class, but it sucks pretty badly. Better to just use winsock functions directly. | |
Re: what's the significance of those delay functions? What is P1 because it isn't defined anywhere in the code you posted. for case G: [code] int a1 = 0x01; for(int i = 0; i < 8; i++) { P1 = a1; a1 <<= 1; delay(); } [/code] or you could create … | |
Re: If you don't know how to start the project then you are not ready to write something as difficult as a chat program. There are lots of [URL="http://www.google.com/search?hl=en&q=vb6+tutorial"]VB tutorials[/URL] -- start there. | |
Re: I think the problem is line 21 of the header file -- you have to have a semicolon at the end of the class. Put a semicolon after that closing brace. | |
Re: [quote]1 001 002 003 2 005 009 004 [/quote] If you look at the data you will see that the student id is just a single character, but grades are all 3 digits left-padded with 0s. So if you read the file in as words (strings) instead of integers you … | |
Re: You might read [URL="http://support.microsoft.com/kb/161088"]this[/URL], especially the comments at the end of the window about [b]SendMessage[/b] command-line function. I don't have Outlook on my computer so I can't test it. | |
Re: If you use std::string and std::ifstream, then you can loop through the file using getline(). Store each string in a std::vector array. The code is very simple, like this: If you only want certain line numbers then just count them inside the loop. [code=c++] #include <vector> #include <fstream> #include <string> … | |
Re: Duoas already told you how to do it -- create a for-next loop and set each element to 0 | |
Re: >> Reputation-Altering Power What is that? both you and I (and probably everybody else too) its value is 0. | |
Re: [code] 41. do 42. { 43. cout << "Enter employee gross sales ( -1 to end )" << endl; 44. cin >> sales; 45. } while(sales >= 0); 46. [/code] you don't need variable [b]sales[/b]. You can enter the values directly into the [b]money[/b] array by using a loop counter, … | |
Re: >>So why doesn't this work? You'll have to be just a tad bit more specific. | |
Re: there are 26 cards in a deck, so generate a list of 26 unique but random numbers. Then if you have a list of cards, just pick them out in the order of the random numbers previously generated. It would be a lot easier to use an vector or list … | |
Re: >>//static double AnnualInterestRate static class variables are just like global variables with a class scope. They have to be declared at the top of a *.cpp file just as if they were normal global variables. [code] // account.cpp file #include "StdAfx.h" #include "Account.h" double Account::AnnualInterestRate = 0; // rest of … | |
Re: you can call the win32 api function CopyFile() -- look it up in MSDN for details | |
Re: Which of the 232 lines does that error occur on ? | |
Re: My guess is you should leave it in the junk. Someone tossed it away for a reason -- most likely because it doesn't work. | |
Re: you will need a get function for each of the variables so that you can do this: [code]writer<<name[x].getID() << " " << writer<<name[x].getLastName() << " " << writer<<name[x].getFirstName() << "\n";[/code] [edit]Or do it like Nurue said above[/edit] | |
Re: in the code you posted, marray is an array of uninitialized integers, which could have any random values. Consequently the code you posted makes absolutely no sense at all. To add up all the values in the array [code] int sum = 0; for(int i = 0; i < numbers; … | |
Re: one way to do it is to create an array of function pointers with associated strings for the name of the function. For example, support you type in "add", you would search the array for that word and when found call the associated function, something like this: [code] struct functions … | |
Re: line 23: endl is only for cout, not cin, so you can delete that part of that line. move lines 22 and 23 up outside the loop (between lines 19 and 20. Then the loop beginning on line 20 will go from 0 to [b]n[/b]. between lines 24 and 25 … |
The End.