209 Posted Topics
Re: Yep, wrong forum, yet I'll fix it. String input; is wrong, change to: [CODE]String input = new String();[/CODE] [QUOTE]i thought they are both the same. [/QUOTE] Do Apple's taste like Orange? | |
Re: The gentlemen above me have done a great job & answered well. I'd just like to add that chars inside switches are in fact converted to their ASCII equivalent ints. :) | |
Re: [QUOTE]Well, this project I'm working on is a Pokedex Program for my little sister for her birthday.[/QUOTE] Awww, so sweet. I used to love Pokemon. All 507 of them (not really all). [CODE] std::string line; while(std::getline(file,line)) { //Here you go. } [/CODE] | |
Re: [URL="http://java.sun.com/docs/books/tutorial/uiswing/"]Java Swing[/URL] should be useful for you & [URL="http://www.netbeans.org/"]NetBeans [/URL]is a pretty decent IDE. Good Luck. | |
Re: You can create a thread Sleep for 1 sec & terminate it. [CODE] HANDLE threadHnd; if(threadHnd=CreateThread(<ReadProc>)) { Sleep(1000); TerminateThread(threadHnd); } [/CODE] | |
Re: [QUOTE]002 10103 [/QUOTE] Is the information stored in separate lines or in continuation? | |
Re: [QUOTE]I know it means that i need to change of the num_as_str but i don't know how i can do it?[/QUOTE] num_as_str.c_str() | |
Re: [QUOTE]Here you will not receive wParam for WM_MOUSEWHEEL notification. lparam->MOUSEHOOKSTRUCT will contain the handle to window which will receive the mouse message corresponding to the mouse event.[/QUOTE] Wrong, 1) wParam will receive WM_MOUSEWHEEL notification 2) lparam->MOUSEHOOKSTRUCT is not a valid identity 3) MOUSEHOOKSTRUCT does not contain any handle to any … | |
Re: [QUOTE]Hey, Do I add a new class file for each class, or can I do multiple (like in C#)? (I have an item.h, and an item.cpp; I'm using Visual Studio.) Cheers for the help.[/QUOTE] Didn't get you. | |
Re: You can just use string::[URL="http://www.daniweb.com/forums/showthread.php?p=1258924#post1258924"]getline[/URL]. | |
Re: [QUOTE]Is there a good way to determine the end of a a line in a text file?[/QUOTE] getline(istream,string) method should work fine. | |
Recently, I've being doing some j2me programming & everything is fine but some of my MIDlets constantly ask for permissions when performing I/O operations on files. I know this is for security purposes but is there any way I can provide a valid certificate for my MIDlet without having to … | |
![]() | |
Re: I'd be using fbody's class for this. [CODE]class parent { public: virtual void myFunc() = 0 ; }; class child1 : public parent { public: void myFunc(){cout<<"Do stuff";} }; class child2 : public parent { public: void myFunc(){cout<<"Do more stuff";} }; void GetInput(parent *ptr) { ptr->myFunc(); } [/CODE] So you … | |
Re: [B]string foo(string myStr);[/B] Was that so difficult? | |
Re: [QUOTE]First, why have you used a typedef? Second, you seem to have declared an object named mynode, then tried to declare things (head,temp,etc) of type mynode. Shouldn't they be type 'node'?[/QUOTE] No it's fine OP has typdef-ed node to bye mynode. Though it's uncalled for when he can just declare … | |
Re: >>So basically the only thing i have to do is to change my codes to .cpp instead? and I won't get these errors? It's worth a shot. Try & echo back. >>D:\Documents and Settings\Riikard\Desktop\Untitled1.c:1:20: [B]iostream: No such file or directory[/B] It can't find iostream. Please see your project settings. >> … | |
Re: [QUOTE]it's that c++ is outputting WEIRD crap that makes no logic sense, doing things out of order, and just seriously screwing things up.[/QUOTE] C is WY[B]C[/B]IWYG (C stands for Code) Did you input users[i] & other data? | |
Re: >> I never use API in C, can you tell me more about that You'll have to start using it then. They ease the burden off your shoulders. Follow Ancient Dragon's advice. >>I suppose you could call GetDesktopWindow() and use that handle in GDI drawing functions. GetDesktopWindow() will return only … | |
Re: >>Ok it is helpful for me but i want to know that if i want to make app like antivirus, process explorer than which language should i preffer. C++. | |
Re: [QUOTE]just copy paste the code into the quotes and add \n for line breaks[/QUOTE] [QUOTE]That will not print the code as it is, will it?[/QUOTE] Define "as it is". If you meant as you typed then yes, it will. If however you meant the very code you wrote, I don't … | |
Re: I highly recommend you use read & write methods to store these data. It will easier for your. [CODE] YourStruct Obj; fstream file("test.txt",ios::in); file.read((char*)&Obj,sizeof(YourStruct)); [/CODE] | |
Re: The process of creating a code happens much before you hit the compiler, my friend. First lay it out neat in your mind, then type it down using the language of your choice. :) | |
Re: [QUOTE] Could you try if(v.size()>2 && v[2]==3)[/QUOTE] This will produce an error *again* if size of v is less than 2, as the condition(v[2]==3) will be processed anyway. The only way I can think of now is: [CODE] if((v.size()>2)?v[2]==3:false) [/CODE] | |
Re: [CODE] ofstream test("Test.htm"); test.close(); char path[MAX_PATH+1]; FindExecutable("Test.htm",NULL,path); //Include <windows.h> remove(test); [/CODE] That ought to do it. | |
Re: [CODE]while( !feof( at_mmi )) // Check for End of File { fgets(read,100,at_mmi); . .[/CODE] You should use: [CODE]while( fgets(read,100,at_mmi);) // Read till available [/CODE] This code worked fine for me. [CODE] char read[]="apple;mango"; char delim[]=";"; char *result; char read_MMI[40],read_AT[40]; result = strtok(read, delim); // Read the AT Command part from … | |
Re: [QUOTE]weird characters appear. I don't know how it's called[/QUOTE] It's called garbage value. [CODE]fn = strtok(NULL, tmp);//taken from file tempo->mName.fname = fn;[/CODE] Are you successful in retrieving the values from file into tmp? | |
Re: [QUOTE]i dont know.. i just copy from the text book, i dont learn programing from basic, please help me banfa,!!![/QUOTE] You sound desperate. Please note that even if Banfa gives you the solution to it, you still won't get it AT ALL, because you won't be knowing what he is … | |
Re: [QUOTE]If u want to update or append to a text file using fopen function call, u can use both "a" and "a+" access modes. For binary an additional "b" character has to be included in the mode string (i.e ab and ab+ or a+b). Mode a : Appends to a … | |
Re: Try putting inStream.clear(), outStream.clear() to clear any eofs. | |
![]() | Re: If the array is sorted, you can pretty much use the 2-D array technique efficiently. If not, it's as good as scanning the array for every index & counting it. [CODE] //This is when array is unsorted. int countArray(int *arr, int size) { int count for(int i=0; i<size;i++) { count=0; … |
Re: Your function does not raise to power instead multiplies x & y. [CODE]z=x*y[/CODE] * is a Multiplication operator *here*. Hint: To raise a power say 2^3, We multiply 2 thrice 2x2x2. | |
Re: [CODE]n = random();[/CODE] If your using this, make sure to call [B]randomize();[/B] before it. | |
Re: [CODE]operator + (const money rhs) const;[/CODE] class objects should generally be passed as reference. Use: [CODE]operator + (const money &rhs) const;[/CODE] | |
Re: Create a class Users having objects "userName" & "passWord" & use funtions to write into a file in binary using read() & write(). It should be a cake walk. | |
![]() | Re: [QUOTE]I am having problems making it use the cost as the weight when determining the shortest path and adding up the miles. It doesn't associate the right cost with the different paths.[/QUOTE] Didn't quite get you back there. |
Re: As Dave suggested [COLOR="Green"]vector<string> myContainer;[/COLOR] is the right(read: safe) way to go; not that yours is wrong. Can you post some sample output to explain your problem further? | |
Re: Here, I'll post some pseudo-code for you: [CODE] boolean boolFTX=false; //Flag for your FTX+AAA while(Read Line) { if(string.indexOf("FTX+AAA")>0) { if(boolFTX) //Concat Strings else { boolFTX=true; //Read Normally } else //Read Normally } [/CODE] | |
Re: [QUOTE]//here the program should execute the code from the dll , but i don't have any idea ,how to do that :([/QUOTE] [QUOTE]In the dll i need to determine which key was pressed, but i have no idea ,how could i do that[/QUOTE] Which one is your exact question? From … | |
Re: If you are coding it with TurboC++, a 16-bit compiler, int is by default "short int" (size: 2bytes) So make it at least [B]unsigned long[/B] to stay within the limits of INT_MAX. Edit: [CODE]System.out.println(count+n1);[/CODE] I guess it's VC++. [QUOTE]the numbers need to be octagon type[/QUOTE] First, it's Octal. I don't … | |
Re: [QUOTE]but if you have any question tell me it.[/QUOTE] As a matter of fact I do. What's your original question? And what's up with the atrocious explanation. I see the code is in another language (German, I guess.), please provide some comments in English. Why are you including "header.h" multiple … | |
Re: Start by learning SQL. There have been many posts regarding SQL-ODBC-C interfacing. Search them. | |
Re: [QUOTE]Edward can't help but think of malware when program requirements include words like "secretly".[/QUOTE] Nisheeth echoes with Ed. :P | |
Re: [QUOTE]HELPP!!!!!!!![/QUOTE][QUOTE]Ok, so im having a [COLOR="Red"]little bit[/COLOR] of trouble[/QUOTE] Irony? [QUOTE]That line makes no sense. If you look at the documentation you will see that get() returns an istream object so using the right shift operator on that return value makes as much sense as mud.[/QUOTE] cin.get() returns an int … | |
Re: [QUOTE]The compiler generates it.[/QUOTE] What! Please do not answer if you [URL="http://logix4u.net/Programming/vc++/A_Tutorial_on_creating_DLLs_with_VC++.html"]DO NOT[/URL] know. You have to create a dlls separately. A dll is not a regular file. It is a library of functions which you can later import depending upon your requirement in your cpp file. | |
Re: ** means pointer to a pointer If it's an 2d-array (**) is *generally* same as (*) | |
Re: [QUOTE]but i want to send all 4 (days, hrs,min, sec) to client.[/QUOTE] Make a data packet & send. It shouldn't be difficult at all. | |
Re: [CODE]if(graphresult()!=grOk){[B][COLOR="Red"]exit(1)[/COLOR][/B];}[/CODE] This is the cause. graphresult() fails. P.S. @OP: How come nobody before noticed it? Because the formatting was bad. Format your code nicely & bugs will come out faster. :) |
The End.