15,300 Posted Topics
Re: The problem is the constructor with the parameter. It also needs to initialize instance variables because the constructor with no parameters does not get called. | |
Re: what a totally useless waste of bandwidth and our time! Whoever filmed that obviously doesn't live where I live because we have millions (billions!) of birds all over the place. | |
Re: [code] while(found!=-1) { found=y.find(x,ind); ind=found+1; if(found==-1) {break;} [/code] The above can be better written like this because it doesn't require so much code and if statements. [code] while( (fund = y.find(x,ind)) != string::npos ) { ind=found+1; // etc etc } [/code] | |
Re: It would be helpful to know what those numbers mean. | |
Re: [QUOTE=vishy_85;845021]hello all , i have to initialize the array of stucture singleIMEIarr to null , using NULL doesnt work , when i assign {'\0'} it doesnt execute. any suggestions at to where im wrong ? [code] struct singleIMEI { string planname; string plandescription; string scriptexec; string startdate; string starttime; string … | |
Re: post a link to the thread that this should have been an answer to and I'll fix it up for you. I can't tell what thread you were trying to answer. | |
Re: [QUOTE=Lucrezia;845115] For example, I would consider an item with 500 voters and 4,6 rating better than one with 50 voters and a rating average of 4,8 but with the common algorithm the second would be considered better (if the voter cutoff limit is lower than 50 of course).[/QUOTE] Statistically one … | |
Re: Its in the registry [icode]HKLM\Software\Microsoft\Windows NT\Product Name[/icode] | |
Re: [QUOTE=maireka;844904]Opti-World has been extremely successful recently. The addition of this it strengthens your position in some of the fastest-growing segments of the business. Get great ideas about your sales and marketing strategy, include information on how the product or service will be priced. There are lots of channels to market … | |
Re: its a poorly written program. >>istringstream sin(line.substr(line.find("=") + 1)); The program will more than likely crash if [b]line[/b] does not contain '=' or if that symbol is the last character on the line. >>if (line.find("num") != -1) line.find() doesn't return -1, it returns string::npos. | |
Re: all you have to do is typecast the character to int [icode]cout << 'A' << " = " << (int)'A' << "\n";[/icode] or [code] char a = 'A'; cout << a << " = " << (int)a << "\n"; [/code] | |
Re: We do not speak gobbledygook. Please explain with a better example and more explanation. Generally, the only way to read the last item of a text file is to read the entire file. | |
Re: >>can anyone help me Can we? Yes. Will we is another question. We are not going to do your homework for you. Use google and you will probably find what you are looking for (the code). | |
| |
Re: The first parameter must be either a static method of a class or a global function. You can't pass class methods unless they are declared static. | |
Re: The code won't compile due in part to use of undeclared variables. | |
[URL="http://www.youtube.com/watch?v=vGeyurkOlqI&eurl=http://www.fuckfrance.com/topic/3357171/1/Discussions/Does-anyone-here-actually-believe-in-evolution.html&feature=player_embedded"]Finally, a complete and accurate explaination of evolution.[/URL]: | |
Re: [QUOTE=tux4life;844216]What a crap this code is ? 60% of your code is full of bugs ... Read your textbook first ! By the way, in future post using code tags ...[/QUOTE] Looks a lot like my code too :) ![]() | |
Re: A literacy test would only work for people whose native language is English. Non-English speaking people might have a difficult time to meet the requirements. | |
Re: >>Does variables in a namespace behaves like a static variable where it will keep the most recent value? No. static variable may appear either inside a class or outside any class. [list] [*]When static variables are part of a class then they require class scoping, such as [icode]MyClass::MyVariable = 0;[/icode] … | |
Re: [QUOTE=olabodeaguda;844204]i guess u are code into a project that u've already compile and use.try to open another project and compile.[/QUOTE] That makes no sense at all -- and please type [b]you[/b] instead of [b]u[/b]; its only two more key strokes | |
Re: why not something like [icode]cc -o a.out obfile.o -lmylib.a[/icode] | |
Re: Welcome to DaniWeb. I always found the concrete patio outside my backdoor an excellent way to repair computers. [list=1] [*] Open Door [*] Toss Computer Out [*] Watch it splatter all over the concrete. [*] Sweep up the rubbish [*] Deposit in trash can [/list] | |
![]() | Re: >>i didn't want to spam the message board. You won't. Just past the code between code tags and you will be all right. We can't copy from that link into our compiler's IDE. [edit]Ok, so I didn't see the [b]Download[/b] button at the bottom of the page :) [/edit] ![]() |
Re: People here generally ignore threads marked [b]Urgent[/b]. >>Can someone "genius" help me to complete this. What parts do you have problems implementing? | |
Re: Read [URL="http://www.ondotnet.com/pub/a/dotnet/2003/03/03/mcppp2.html"]this[/URL] [URL="http://lmgtfy.com/?q=how+to+mix+managed+and+unmanaged+c%2B%2B+code"]and this[/URL] | |
Re: >>The code is not able to open the input file. Obvious answer -- the input file doesn't exist or is not where you think it is. | |
Re: Did you read the threads in DaniWeb Community Feedback? There are a couple threads on that topic. | |
Re: why are you opening the text files in binary mode??? Just open it in text mode [code] // not that ios::in and ios::out flags are not needed for ifstream and // ofstream ifstream infile (ascifile); ofstream outfile( binfile ); while( infile >> Index1 >> Index2 >> simvalue ) { outfile.write((char … | |
Re: you need to pass the string by reference. in GetArray() the string is local to the function so when the function returns the string is destroyed, invalidating the return pointer. [icode]const char* getArray(string[color=red]&[/color] s){[/icode] Actually the function doesn't need the temp pointer at all. [code] const char* getArray(string& s) { … | |
Re: Microsoft compilers do not use unistd.h -- that's for *nix. And Microsoft put an underscore in front of the name, so its [URL="http://msdn2.microsoft.com/en-us/library/sf98bd4y(VS.80).aspx"]_getcwd().[/URL]. The link contains example code too. | |
Re: probably something like this: [code] std::string str = "<html>"; if( str.find("<") != string::npos && str.find(">") != string::npos) { // most likely an html tag } [/code] | |
Re: After line 19 you need to flush the input buffer of the '\n' character. [icode]cin.ignore(1000,'\n');[/icode] should do the trick. | |
Re: >>this post is not about telling you not to use C++ preprocessor Good, because it is not possible. >>How to generate the preprocessed file . well GCC you can , but MS VC++ I even yet don't know. | |
Re: OMG! Why don't you simply use vector's erase() method to delete an inventory item instead of all those assignment statements :scared: | |
Re: line 13: >>if((argc > 1)&& !strcmp(argv[1], "-d") && (argc > 2)) All you need is one check for argc [icode]if((argc > 2)&& !strcmp(argv[1], "-d"))[/icode] Also post a few lines from the text file. | |
Re: you need to adjust the pointers [b]next[/b] pointers too. such as [icode]temp->previous->next = temp-->next;[/icode]. If your linked list does not have a [b]previous[/b] pointer, then you need to keep track of it while iterating through the list in lines 4 and 5 of the code you posted. | |
Re: "a simple os" and "gui interface" are contradictory statements. Something like MS-DOS 1.0 was a simple os. Once you add gui it becomes very very complicated. | |
Re: [QUOTE=everard;841310]When I compile the program, I always got this error message: C:\LOGFILE_INTERPRETER\LOGFILE_INTERPRETERDlg.cpp(355) : error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'unsigned int (void *)' Error executing cl.exe. Does anyone knows what is the problem with my codes?[/QUOTE] Which one of those line … | |
Re: >>I am getting a linking error stating buffer is too small There is no such linking error. Post the exact error message. >>strcpy_s(cstr,sizeof(cstr), str.c_str()); That is wrong because sizeof(any pointer) is always 4 on a 32-bit compiler. what you want is str.size(). >> *tail--; >> *head++; remove the stars because … | |
Re: Your compiler is correct. If you want that function to return something else then change the return type on line 5 of the *.cpp file, and also in the class declaration. Functions can not return arrays like you are trying to do in line 162 of the code you posted. … | |
Re: doesn't matter why -- gets() is a horrible function anyway. Use fgets() instead of gets(). And if you really want the source code for that standard C function then download the gnu compiler source code. | |
Re: what errors? I can not see your monitor. | |
Re: I know a sociologist (Ph.D.) who did that. He wrote a book and made $Billions. | |
Re: i had a problem a little while ago, just assumed you were working on the servers. Didn't last more than 5-10 minutes. | |
Re: Welcome to DaniWeb. >>Just built custom computer and i want to learn linux Good luck! Come back in about 10 years and tell us how it went :) | |
Re: [QUOTE=shadowmann2330;841767]i have heard that i need to "fulsh the input" please help me![/QUOTE] [URL="http://www.daniweb.com/forums/thread90228.html"]read this thread[/URL] Your coded would look a little better if you used a switch statement instead of all those if statements. [code] cin >> numberofopponents; switch( numberofopponents ) { case 1: // blabla break; case 2: … |
The End.