15,300 Posted Topics
Re: Please deposit $10,000 USD in my paypal account and you will get your program. | |
Re: [code] std::string ip1,ipc1; cout<<"Enter the Ip Address:\t "; cin >> ip1; ip1 = "ping " + ip1; system(ip1.c_str()); ipc1 = "nbtstat -A" + ip1; system(ipc1.c_str()); [/code] The above won't work. Why? Think about the value of string ip1. After [icode]ip1 = "ping " + ip1"[/icode] the string is something like … | |
Re: replace KeyType with int to see what happens. >>void main() [URL="http://www.gidnetwork.com/b-66.html"]Its [b]int main()[/b][/URL] | |
What is that green tweet button with a number next to it used for? (located just under "Business Exchange" menu) Sometimes I see a 1 and other times a 0. Does that just mean Dani has posted something on tweeter.com? | |
Re: What is wrong is that you are using some crappy compiler such as Turbo C to run an MS-Windows 32-bit program. Can't be done. Toss out that compiler and use a modern compiler such as Code::Blocks (with MinGW compiler) or VC++ 2008 Express -- both are free. Also: the / … | |
Re: You did not post anything that needed an assignment operator =. Assignment operators are not used in class declarations. Maybe you mean the overloaded = operator??? Your class doesn't have any public members, so none of its objects (p1 and p2) can be accessed outside the class. | |
Re: You need an account on tweeter.com to make that work. It worked for me. BTW I'm Superman :) | |
Re: It all depends on your compiler's memory allocation algorithms. Some compilers to not return deallocated memory to the operating sytesm; instead they keep it so that it can be reused. | |
Re: You can specify the language, such as [noparse][code=html][/noparse]. I don't know if you can successfully specify more than one language in the same post -- you'll just have to try it and find out what it does. | |
Re: 1) Line 13 is wrong. It should use the == boolean operator, not the = assignment operator. >>If not, specify a situiation in which this version will fail. I can think of three kinds of data for which that algorithm will fail. If you think about the different kinds of … | |
Re: >>Mm..I'm not sure how to edit my post? There is a time limit. You have 30 minutes to edit a post. >>I still can't figure out how to read 24 lines at a time Just put getline() in a loop. Note that testing end-of-file with eof() is not necessary nor … | |
Re: >>I'm using VC++ 6.0. You won't be able to use that compiler if you think you need to write 64-bit code. Upgrade to vc++ 2008 Pro or the new vc++ 2010 Pro (the Express versions are not adequate either because they don't produce 64-bit code). I know you can create … | |
Re: Do you mean you read a c++ tutorial (you did NOT write it), and you want to know how to compile it? What compiler do you have? Each compiler is different. | |
Re: There is no standard way of doing that in C language. But one method is to use non-standard conio.h function getche(). If your compiler supports that function then you can use this program to find out what values your keyboard sends for any key on the keyboard, including arrow keys. … | |
Re: You have to write two different functions, then in one of them you can call the other, like this [code] int foo() { return 5; } int main() { int x = foo(); } [/code] | |
Re: The general way to get the file size is to seek to the end of the file then get the current file position. I don't know how you would do that with CLR/C++ (managed code), but I'm certain if you read the available methods in FileStream you will find it. | |
Re: I don't see any syntax errors, assuming array Games is part of that class or a global variable. But the function won't work. Why? See line 5. | |
Re: Post #2 of [URL="http://www.dreamincode.net/forums/index.php?showtopic=144998&hl="]this thread [/URL]contains an algorithm you will need if you want to use a dynamic-sized array instead of a vector. Reallocating memory to expand the array's size can be a little complicated to understand for new programmers, so using a vector would be ideal. | |
Re: [code] #include <iostream> #include <string> using namespace std; int main() { std::string ip1; cout<<"Enter the Ip Address"; cin >> ip1 ip1 = "ping " + ip1; system(ip1.c_str()); return 0; } [/code] | |
Re: [QUOTE=sillyboy;474689]Oh, where is the explanation? :([/QUOTE] In the ISO standards -- read Salem's post above, but I guess you did not or you would not have asked this question. | |
Re: you forgot the [b]case[/b] keyword. Your program contains millions of other errors that you need to correct -- if your compiler doesn't report them then toss out that crappy compiler and get one that actually works right. [code] int area(shape *s) { switch(s->st) { case RECTANGLE: return (s->shape_u.rect.side1) * ( … | |
Re: Did you try [icode]your2darray[y][x] = "Hello";[/icode] or this? [code] vector<CString>& s = your2darray[y]; s[y] = "Hello"; [/code] | |
Re: One way might be to enhance the daemon to listen on a socket in another thread and the other program can open the socket and send daemon some information. | |
Re: Functions know nothing about variables declared in other functions. If you want selectionSort() to use variables in another function then those variables have to be passed to selectionSort() as parameters. | |
Re: There is no quick and easy solution because graphics is a complicated topic. You could do it by calling win32 api functions -- such as [URL="http://www.google.com/search?client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&channel=s&hl=en&source=hp&q=win32+api+tutorial&btnG=Google+Search"]this intro tutorial.[/URL] Or you could do it with a different language, such as CLR/C++, or C#, or VB.NET. Graphics is going to take a … | |
Re: Maybe [URL="http://lmgtfy.com/?q=solaris+file+system"]this will help you[/URL]. | |
Re: The only ways for Player to access functions in Map is one of the following [list=1] [*]Player is derived from Map, such as [icode]class Player : public Map[/icode] [*]The functions in Map are static and public. [*]Player contains an instance of Map. [/list] | |
Re: What operating system? If MS-Windows then use win32 api mouse functions. | |
Re: The [b]extern[/b] keyword must be used in header files like global.h to avoid duplicate declaration errors when you include the header file in two or more .c files. | |
Re: If you intend to modify Andy's contents from different threads then you need to synchronize the threads so that access to Andy is limited to one thread at a time. The most common way is via [URL="http://msdn.microsoft.com/en-us/library/ms682438%28VS.85%29.aspx"]semiphores[/URL]. For platform independece -- you might check out the [URL="http://www.boost.org/doc/libs/1_41_0/libs/libraries.htm#Memory"]Boost libraries[/URL] to see … | |
Re: I don't know about other languages, but in c++ I think it is always possible to remove it, because there is such a thing as namespaces and function overloading. Often an "ambiguous" error message means there is a programming error in the parameters (such as mis-matched data types) and the … | |
Re: >>In the case of 'c++' the VM (Virtual Memory) and PM (Physical Memory) becomes larger every minute. Memory leak. Check your program for memory allocations that were not freed before a function ends. Quite possibly in pPaymentAcsPtr->CheckCardBefore() since your program is calling that function 150,000 times :icon_eek: | |
Re: Hint: See the example program at the end of [URL="http://msdn.microsoft.com/en-us/library/2e70t5y1%28VS.80%29.aspx"]this article[/URL] | |
Re: wtf??? FoxPro and VS are two completly different things. FoxPro is a database, VS is a compiler. | |
Re: 1) you can not compare a single character such as aData with a string such as "Exit". 2) 'Exit' must be surrounded with double quotes, such as "Exit". | |
Re: The is setting up the function's stack, allocating local variable space on the stack, and initializing them with 0x0c for debug purposes (helps to detect buffer overflows). Similar code is at the beginning of every function. | |
Re: What you need is an array of character pointers. When you enter the number of strings then allocate that many character pointers [code] char** array = 0; int numNames = 0; printf("How many names will you be entering?\n"); scanf("%i", &numNames); if( numNames > 0) { array = malloc(numNames * sizeof(char*)); … | |
Re: [URL="http://www.daniweb.com/forums/misc-explaincode.html"]Read this link (click here)[/URL] | |
Re: Posting an up vote is not going to erase that down vote. You will still have the down vote. | |
Re: Going from XP to Win7 can be somewhat rough because things have moved, such as your home directory is not where it was in XP. Also if you get a computer with 64-bit motherboard then you will have 64-bit Win7, which in itself if quite nice. 64-bit Win7 is a … | |
Re: Would you believe there are still a few commercial manufacturers who still use computers that run ancient MS-DOS 6.X operating system. I know of at least two who are still running some old MS-DOS programs that I wrote 12+ years ago. One reason they are still using them is because … | |
Re: What is going on in that code is called [b]undfined behavior[/b] and will not work. Why? Because [b]ptr[/b] is an uninitialized pointer, and dereferencing it like [icode]*ptr = (put anything here)[/icode] is illegal and will most likely crash the program. The second problem with that code snippet is [icode]*color++;[/icode] on … | |
Re: Here is another way to do it. [code] string space2underscore(string text) { for(int i = 0; i < text.length(); i++) { if( isspace(text[i]) ) text[i] = '_'; } return text; [/code] | |
Re: There are several sort algorithms you could use, the[URL="http://www.cprogramming.com/tutorial/computersciencetheory/sorting1.html"] bubble sort [/URL]is ok for small arrays like yours. | |
Re: >>int OptionMenu(int); Since that function is returning the option selected there is no need to pass any parameters to it. Then in main() just write [icode]menunumber = OpenMenu(); [/icode] | |
Re: There is no need for the pack() functionality. The account class is already packed (fixed-length). Just write the account object to a binary file. [code] void write(Account& obj) { ofstream out("filename.dat", ios::binary | ios:: app); out.write( (char*)&obj, sizeof(Account)); out.close(); } [/code] similar to read it [code] void read(vector<Account>& accountList) { … | |
Re: 1) delete lines 10-36 because they are redundent. The array [b]counts[/b] was already populated with the correct values in line 9 and there is no point doing it all over again. 2) line 44 -- that's almost an infinite loop. On every loop iteration the value in counts[i] changes. When … | |
Re: [code] char direction[4]; // in or out char type[8]; // such as int, char, etc char name[25]; // variable name char value[10]; char filler; // just ignore the = symbol while( in >> direction >> type >> name >> filler >> value ) { // do something with this information … | |
Re: I'm assuming English is a second language for you, which may be why you have trouble asking for help. The first thing I would do is to design a structure to hold the information for one student. Since there needs to be a linked list that structure will have to … | |
Re: Sorting becomes a lot easier if you use a structure to hold each person's information instead of individual arrays. Something like this: [code] struct person { char name[MAX+1]; vector<float> sales; } [/code] Note that [b]amount[/b] needs to be either an int or float, but never char. Assumes you are allowed … |
The End.