15,300 Posted Topics
| |
Re: >>char *post = "request=register&uniqueid=" + uniqueid; You can not concantinate C style character arrays that way. It has nothing to do with libcurl -- just plain old C syntax error [code] char post[255]; strcpy(post,"request=register&uniqueid="); strcat(post,uniqueid); [/code] Of course you could use std::string to make it a little easier, and safer … | |
Re: line 24: using an uninitialized pointer [b]ptr[/b] You have to allocate memory for it before it can be used. line 57: [b]child[/b] is NOT an array of pointers to structures, but an array of structures. There is a difference. In the structure you need to declare child like this: [icode]struct … | |
Re: Console program? Use your mouse, right-click on the text, select "Mark" from the menu, highlight the text then press <Enter>. Next, in Notepad press Ctrl+V | |
Re: Here is a simple example. The only reason it includes windows.h is because it uses the win32 api function Sleep() It will become more complicated if each of the threads must access the same global variable or common function. In that cast the threads have to be synchronized to avoid … | |
Re: Within the same class -- yes. Otherise, no. | |
Re: line 86: you are calling the function wrong [icode]findLowest(testScore, sz );[/icode] But that will produce another error because [b]textScore[/b] is NOT an array of floats, but a single float variable. | |
Re: [URL="http://lmgtfy.com/?q=c%2B%2B+data+structures"]try this[/URL] | |
Re: Put this at the beginning of main() to hide the window and include windows.h [icode]ShowWindow( GetConsoleWindow(), SW_HIDE);[/icode] | |
Re: Character arrays can not be compared like that. Either use std::string instead of char or call strcmp() to compare the two strings. [icode]if( strcmp(name,"John") == 0)[/icode] strcmp() returns 0 if the two strings are the same. | |
Re: try [URL="http://www.boost.org/doc/libs/1_36_0/libs/python/doc/v2/pickle.html"]boost libraries[/URL] | |
Re: vc++ 2010 Express Code::Blocks google for them and you will find the links | |
Re: If you have a boot loader and you want it to execute a c program then the boot loader can't just simply use the call statement to do it. Your boot load will have to first load the c program into memory and then start executing it at the beginning … | |
Re: I would create a function that reads a file into an array. The parameters to that function would be the name of the file and the array. Then in main() -- or somewhere else -- call that function as many times as you want to with different parameters each time. … | |
Re: I assume you mean [URL="http://transaction-terminals.com/94pos/overview.html"]this machine[/URL]. You will have to get the programming details from the manufacturer. Contract them and they will be able to help you. | |
Re: line 20 should be: [icode]contributors * thePatrons = new contributors [numberOfContributors];[/icode] | |
Re: This is a case where using [icode]using namespace std;[/icode] is destroying your program. The compiler doesn't know whether to use the pair class you wrote or the one in std namespace <utility> header file. Replace that with [icode]using std::cout;[/icode] and that error will go away. | |
Re: >>$ g++ EmployeeList.h You can't compile header files like that [icode]g++ EmployeeList.cpp[/icode] | |
![]() | Re: >>while (fgets(line, MAX_BUFFER, infile) != NULL){ [b]line[/b] is a NULL pointer. You must allocate memory for it before you can use it here. Add this somewhere before that loop [icode]line = malloc(MAX_BUFFER);[/icode] |
Re: Help you do what?? Instead of begging people to do your homework for you why don't you try to do it yourself, post what you have tried, and then ask specific questions about what you don't understand. | |
Re: line 19: [icode] >> "\t"[/icode] YOu can't do that with input streams. If the fields are separated by tabs and do not contain any spaces then istream will auto skip the tabs. If there are any spaces in the fields then you can't use >> operator, but must use getline(), … | |
Re: I have never "smim"ed in my life. Can you post a picture of someone smimming so that we know what it is? | |
Re: There are SOOO many to choose from! Murder She Wrote Diagnostics of Murder Law & Order Criminal Intent Law & Order Special Victims Unit House ER Golden Girls MASH I Love Lucy The Honey Mooners Upstairs Downstairs Benny Hill Dr Who All Star Trek series and movies BattleStar Glatica Jack … | |
Re: Look in your program and see where WL_HMAC_SHA1 is used. right click on it and select GoTo Declaration. Hopefully the IDE will bring up the header file in which it is declared. Make sure you have PocketPC SDK installed and the hardware vendor's SDK. | |
Re: [icode]vector<Weapon> wp;[/icode] | |
Re: you can only put inline executable code in a header file -- mark that function as inline, like you did the other functions. It is customary to put inline functions inside the class definition, not outside of it. [code] #include <iostream> #ifndef EMPLOYEE #define EMPLOYEE class Employee { public: Employee(long … | |
Re: See [URL="http://www.daniweb.com/forums/thread121245.html"]This thread[/URL] | |
Re: add [icode]#pragma comment(lib,"Winmm.lib")[/icode] somewhere in your *.cpp program, preferably before main() BTW the program works ok on my computer -- 64-bit Windows 7. | |
Re: Sorry to say but that is not a linked list -- its just an array. Linked lists look somethig like this: [code] typedef struct _tagNode { struct _tagNode* next; struct _tagNode* prev; // circular list char name[30]; // node data } NODE; NODE* head = 0; NODE* tail = 0; … | |
Re: Continue posting and you will eventually find out what they are. Some members (mods, previous mods, and members who have made monetary contributions) can customize the rank title. | |
Re: You need to add anothe integer to keep track of the loop counter when the value of biggest is changed so that the program knows which array element contains the largest value. Then you can just simply return [icode]return &a[bignum];[/icode] where [b]bignum[/b] is whatever you want to name the new … | |
Re: >>if you can write the rest i would be greatly appreciated Please deposit $1,000,000.00 USD in my PayPal account and I'll be glad to write it for you :) | |
Re: The maintenance stage kicks in after the software has been finished, tested, and released. This stage consists of fixing bugs and possibly simple or small new requirements. | |
Re: you have to make x1 the base class of x2. Study up on [URL="http://www.codersource.net/c/c-tutorials/c-tutorial-on-inheritance.aspx"]ingerentence[/URL]. In your example X2 will be unable to access the private variables of X1 -- you will have to make those variables either protected or public. [code] class X2 : public X1 { // blabla }; … | |
Re: Is this [URL="http://www.physicsdaily.com/physics/Energy"]a physics lesson[/URL]? | |
Re: That the constructor throw an exception if the parameter data is not valid. This is the simplest kind of exception handline -- in actual program you will want to expand it to throw better exception messge. [code] class MyClass { public: MyClass(int one, int two) { if( !one || !two) … | |
Re: What do you mean "boot a c++ program" ? Compile it? You need a good c++ compiler such as Code::Blocks or VC++ 2010 Express. | |
Re: What is it supposed to do? Use a debugger to single step through the program to see why it doesn't do what you want it to do. | |
Re: It would be easier to create the thread outside the class, in main() for example, and then instantiate the c++ class inside the thread function. I don't know how to create a thread in *nix so you will have to figure that one out yourself. But here is the general … | |
Re: You are pretty much SOL if you think you can do that without using any of the operating systems API functions because the OS will not permit your program to directly access the hardware. I assume you are talking about USB flash drie, not a memory card. They don't need … | |
Re: [quote] [b]Legal Notice[/b] This is an official notice that LimeWire is under a court-ordered injunction to stop distributing and supporting its file-sharing software. Downloading or sharing copyrighted content without authorization is illegal [/quote] My advice is to buy with your $$$ the software you want instead of stealing it. | |
Re: >>The problem is when I enter 7 digits for Id it works No it does not work because the ID field of the structure is not large enough to hold a string of 7 characters plus the NULL terminating character. You need to increase the size of id to 8 … | |
Re: line 2: delete conio.h because its non-standard and non-portable. line 16: void main(){ It's always [icode]int main()[/icode] void main() is non-standard and therefore non-portable. | |
Re: [URL="http://www.google.com/search?source=ig&hl=en&rlz=1G1GGLQ_ENUS397&=&q=winsock+tutorial+c%2B%2B&aq=1&oq=winsock+t"]tutorials here[/URL] | |
Re: line 8: ios::out is not valid for ifstream. ifstream is inut stream, not output. Similar for line 13. You have the two backwards. You don't need either ios::in or ios::out because ifstream is always input and ofstream is always output. For tet files the only parameter that is needed is … | |
Re: >>How am I ever going to figure out the actual algorithm for the functions!! Just like everyone else does -- use your compiler's debugger and single-step through the program at runtime. | |
Re: The tokens array should be an array of pointers. what will happen if you enter a word with more than 19 characters? Anbswer: buffer overflow. The following will be ok as long as you are not going to change the contents of sentence again, such as use that characte array … |
The End.