15,300 Posted Topics
Re: put the locks in writestring(). | |
Re: Your emergency is not our problem. And we will not do your homework for you. As suggested in that assignment you can solve it with MathLib or some other ways. Why don't you discuss this with some of your classmates ???? | |
Re: I think you need to count the sentences and words independently -- that is use a different index for each. I didn't compile or test this, but something like this might work. [code] int sindex = 0; // sentence counter int windex = 0; // word index for(int i = … | |
Re: >>Anyone see where my garbage is? No -- I keep mine in garbage cans outside my house so that the trash truck can take it away each Tuesday morning :) Sorry if that was a bad joke. American Idol just started so I have to watch it. Be back in … | |
Re: that error message means that you are attempting to pass a std::string object to printf, but printf() required an integer -- "%d" is an integer, not a string. If all you want is the first character of a string then you need to access it like this: [icode] array[i][1][0][/icode], otherwise … | |
Re: I guess you mean that you want to append a random number to a string array? [code] #include <sstream> #include <string> using namespace std; int main() { string s = "Hello World"; int rnd = rand(); stringstream stream(s); // append the random number to the string stream << rnd; // … | |
Re: in OneFile.h you have to declare that variable with the [b]extern[/b] keyword [icode]extern int Number100;[/icode] Then in one of the *.cpp files [icode]int Number100 = 0;[/icode] | |
Re: If you are using MS-DOS or MS-Windows you can draw lines draw [URL="http://www.asciitable.com/"]extended ascii codes[/URL] See the chart for other line-drawing characters. The other characters will not appear on your screen or show up as small circles/squares because most fonts don't use them for anything. Simple example: [code] int main() … | |
Re: [URL="http://www.alhem.net/Sockets/download.html"]Here is a library [/URL]and the site has a tutorial how to use it. | |
Re: [QUOTE=MidiMagic;508916]Mass transit doesn't work, unless a lot of people want to make the same trips. In a city like mine, there are so many different possible trips that mass transit to cover even a tenth of them is prohibitively expensive. [/QUOTE] St Louis began a mass transit rail system about … | |
Re: [QUOTE=nurulshidanoni;552303]What is the class of Display? error C2061: syntax error : identifier 'pair' error C2109: subscript requires array or pointer type error C2227: left of '->Display' must point to class/struct/union [code=C++] { int pair; const int student_size = 12; pair <int> * pair[student_size]; // Declare an array of pointers to … | |
Re: line 6: it would be more efficient if you passed the structure by reference (pointer) instead of by value. Note the asterisk below. You have to make similar change in the actual function. [icode]void proceed(struct registration* com, int matric);[/icode] line 32 and other similar lines -- you don't put the … | |
Re: lines 1, 2 and 3. Current c++ standards do not allow for .h extension for system files. Unless you are using a very old compiler such as TurboC++ then it should be this: [code] #include <istream> #include <cstdlib> #include <fstream> using namespace std; // optional using std::cout; using std::fstream; using … | |
Re: Lets say you have 5 strings, you need to generate a randome number between 0 and (but not including) 5. Use the mod operator % to accomplish that [icode]int num = rand() % 5;[/icode] | |
Re: why use two different character arrays when you can do it directly in the original, assuming the original is not string literals [code] char str[] "hello world"; str[0] = toupper(str[0]); [/code] | |
Re: Do it the same way that I said you can change the mouse in your other thread. Seems like you are attempting to write a prank program ????? | |
I was unable to access DaniWeb for several hours this morning and for a few minutes again this afternoon -- began experience withdrawl symptoms :) Just me, our lousy wether today, or did you have computer problems? | |
Re: The code you posted is C, not C++. [quote]/* Reset the original values after we print the result */// printf("%d raised to the %d power is %.0lf\n",parmA,parmB,*powerArgs(&parmA, &parmB));[/quote] Sorry, but your version of powerArgs() doesn't raise paramA to the power of paramB. Nor does it return anything so you can't … | |
Re: Welcome to DaniWeb -- looking forward to seeing you around frequently. | |
Re: Welcome to DaniWeb. I consider myself to be mechanically disadvantaged -- don't know a screwdriver from a shudge hammer :) It takes 100% of my mechanical ability to find the hole to fill up the gastank. But there are a lot of other very capable people here at DaniWeb who … | |
| |
Re: Welcome to DaniWeb. And -- 1) So am I sometimes 2) Yup, me too 3) how can something be useless if its difficult ? 4) I was only wrong once in my life, when I thought I was wrong, but I was wrong. :) >>Season's Greetings Procrastinating ;) Hope to … | |
![]() | Re: right, but you could have written your own little one-line program to prove that for yourself. |
Re: VB will teach you a lot of things that are common to nearly all languages, such as data types (integers, strings etc), loops, and file systems. So pay close attention to what you are learning because they will be valuable later on. My recommendation is to begin learning c++. You … | |
Re: add getch() just before the return statement so that you can see the output. Otherwise your program works just great. | |
Re: >>please correct this program... please!! i need it badly So, what is wrong with it? line 25 uses the wrong input function. fscanf("%s" ...) stops reading on the encounter of the first space. You should use fgets() instead to get the entire line [code] while( fgets( numIn, sizeof(numIn), spIn) ) … | |
Re: >>and some constructive criticism ok, here goes >> void main() never use it. [URL="http://www.gidnetwork.com/b-66.html"]Read this[/URL]: lines 13-19: that an onconventional way to initialize variables. It will work, but that form is rarly ever used. more commen is [icode]int iTurn = 1;[/icode] "\n" is usually preferred to endl because endl also … | |
Re: Ohhh you are an evil one :) :) Several (ok many) years ago during MS-DOS 6.X days I played a similar prank on my boss. I wrote a tiny C program that did nothing but display "Formatting drive c: Please Wait ...". I ran it on his computer after he … | |
Re: >>Any ideas? You don't have to actually save each individual number in order to calculate the average. But if you want the values for something else then save them in an array or better yet in a file which doesn't take up much RAM. And my guess is that the … | |
I've had this happen several times today -- push the submit button and an error message is produced. If I refersh the page my post was made correctly. | |
Re: why don't you post the code that actually gets the errors. What you posted is what you want to do but not necessarily what you actually did. I know what you are attempting on line 11 can be done because I've done that quite a few times too. | |
Re: >>3 meet 36 is 1 how did you get that result? what is the mathametical formula ? | |
Re: This morning I woke myself and my wife up laughing at some cartoon character. I don't recall the details but it must have been pretty funny. | |
Re: [URL="http://www.asciitable.com/"]ascii conversion table[/URL] [URL="http://www.ascii.cl/conversion.htm"]hex, decimal, octal, bin conversion table[/URL] | |
Re: you could sort the numbers then its easy to find the middle one. Or add them all up, divide by 5 then check each of the numbers to find the one that is closest to that. 5.63 + 10.5 + 16.7 + 20.6+ 10.9 = 64.33 64.33 / 5 = … | |
![]() | Re: After getting the input string you could validate the string by first checking the string length to insure it is the correct length, then enter a loop and use isdigit() to check that each character is a digit or compare with ':' for a colon. If it passes all that … |
Re: I think you need to study c++ until you have learned it well before attempting to do complex things like sockets, server/client, networks. | |
Re: you need to read the description for fork() [quote] On success, the PID of the child process is returned in the parent's thread of execution, and a 0 is returned in the child's thread of execution. On failure, a -1 will be returned in the parent's context, no child process … | |
Re: I didn't like him either -- he was a real big stuffed shirt, more IQ then he knew what to do with. He came from privledged elete and was never hesitant to let everyone know it. RIP Buckley. | |
Re: Right now I'm into diet Sunkist Orange soda, diet A&W Rootbeer, diet A&W Cream Soda, and diet Coke. Also love unsweetened ice tea. | |
Re: Censorship is not always bad -- often serves some good purpose such as deleting government secrets (classified material), company secrets (such as how do they put the M on a piece of M&M candy?), criminal offenses of underage children, adoption papers, and the list goes on and on. We the … | |
Re: It will help to know what inputs you used that caused the problem. | |
Re: line 53: you have to use printf() to do that. puts() only accepts one parameter and that is the string that is to be displayed. I don't know what other errors you want to know about. You'll have to be very specific. | |
Re: Static methods can not call non-static methods. You will have to design some other solution to calling that method, such as making it static also. | |
Re: [code]matrix[i][j]= {" ------------ ---------------------- \n","| | |____ | | | |__ | ____ | |\n","| ____ |___| | | | __|_ | |____| _ |\n","| |____| | _|_ |__ | | | __|_ | |\n","|_|_ _____ | |_____ ___|\n","| ___ |_ | ________ | |\n","| | | ____ | | … | |
Re: Why do you want to convert that code to switch? It's not a good candidate for that. line 3: where is [b]dir[/b] declared ? line 5: The == operator is a boolean operator, not an assignment operator. So, as writtin, that line does nothing. If you intend to set [b]row[/b] … | |
Re: I think the problem is with [b]ostream[/b] -- you missed the namespace either std::ostream or add using namespace line. |
The End.