15,300 Posted Topics
Re: That doesn't tell much. Appears like the program is just writing one word to the file then attempting to read it back. The open() statement you have will erase everything that's already in the file. If you want to add more words every time you run the program then you … | |
Re: [QUOTE=briansmall;495359]No I don't .. and I sure didn't mean for that smiley face to show up either. I entered a simple colon-end parens ..[/QUOTE] Before you press the [b]Submit Reply[/b] button scroll down the page and you will find a checkbox under [b]Miscellaneous Options[/b] to disable smilies in the post. | |
Re: >>how can someone (namely myself) tell if the code is written in C or C++? firstly by the header files. iostream is c++ only. >>the window closes. Because you have to add some code to stop it from doing that so that you can see the output. The console window … | |
Re: >> dont know how to display the contents in my program You only use one set of code tags. I deleted all your code because its too much trouble to fix., so please repost and use code tags correctly. Here's how to do it. [noparse] [code=c] // put your code … | |
Re: you can write a wrapper function in the *.cpp file that the C function calls, then let the wrapper function call the class method. The following function can be called by C programs. [code] // c++ file extern "C" int foo() { // call c++ class function } [/code] | |
Re: Don't be in such a damed big hurry! Afterall you only made your post 25 minutes ago. Give it at least a couple days for people to read your post and respond (if they want to). | |
Re: where is the array [b]A[/b] declared ? >>I don't know how to call these values. You don't call values -- you call functions. So I don't really know what you are asking here. >>I can only think of return A[i][j] and that doesn't work why not? what are the some … | |
Re: Read the [URL="http://www.libsdl.org/download-1.2.php"]tutorials and other documentation[/URL] | |
Re: lines 8 and 16: remove the semicolon on those two lines. I assume you are attempting to write functions there ??? If that is correct then you can not nest functions inside other functions like that -- see main() on line 3. Move the code for those functions outside main(). … | |
Re: My advice: rewrite it in C or C++. If the data is sent across serial port then use MSCom1 dll for the communications -- I thik its probably compatible with Win98. Use sokets if the data is sent across the internet. | |
[URL="http://www.ksdk.com/news/watercooler/hot_topics_article.aspx?storyid=141828"]teach exercise classes at the W[/URL] Just saw this on TV local news. What an inspiration -- hope I'm that active at her age :) [quote] The instructor is Louise Larsen and she's 90 years old! "She loves teaching. She loves fitness," says Kirkwood YMCA manager Diane Wagner. "She just … | |
Re: >>strcmp(chartryname, charname)==0 && (chartrypassword, charpassword) ==0 Like this: [icode] if( (strcmp(chartryname, charname)==0) && (strcmp(chartrypassword, charpassword) ==0) ){ [/icode] | |
Re: What about inheritance do you need help with? | |
Re: you don't need cstdio header file, and never ever use gets() even in c programs. Use getline() in c++ to get strings [code] cout<<"input your name: "; cin.getline(name, sizeof(name)); [/code] You don't have to use cin.ignore() after getline(), only after entering integers [code] int x; cin >> x; cin.ignore(); [/code] … | |
Re: >>2. Are too complicated for me to understand. multithreading can be complicated. I use the win32 api functon CreateThread() to create a thread. Not all that complicated once you realize many of the paramters are left 0 :) [code] DWORD WINAPI ThreadProc(void * lpParameter) { // This is the start … | |
Re: >>I need help work wil not compile Same questions as I posted in your other thread. I'm not a mind reader and I can't see your monitor. | |
Re: >>Whats am i doing wrong it is not compile Errors ??? compiler ? operating system ? | |
Re: [QUOTE=willcomp;555123]Newegg is the site of choice for most. Tiger Direct has some good buys, but most involve mail in rebates. [url]http://www.newegg.com/[/url] [url]http://www.tigerdirect.com/[/url][/QUOTE] Agree -- that's where my son always gets parts. | |
Re: Do the requirements one small function at a time. Code, compile, fix erorrs, then compile again. Repeat that until all errors have been fixed before doing any more of the program. You can start like this: [code] #include <iostream> int getDrawers () { // put your code here } // … | |
Re: line 5: remove the open parentheses after =. line 8: replace close parentheses with a semicolon lines 9-17: you can not put the calculations here because the value of [b]input[/b] is not yet known. line 20: its a big mess :) you are mixing c's printf() format specification with c++ … | |
Re: >>Also, I have no doubt there are better ways to emulate getch(), if you know of one please point me in the right direction. Its called [b]curses[/b]. | |
Re: run the program from a command window instead of from Dev-C++ IDE. | |
Re: The link you posted is used by the Microsoft Foundation Class (MFC) which is a set of c++ functions that wrap the win32 api functions. In order for that program to be useful to you, you must have one of the [URL="http://msdn2.microsoft.com/en-au/vs2008/products/default.aspx"]Microsoft compilers[/URL] that supports MFC and those compilers are … | |
Re: [QUOTE=os.hacker64;555220]I doubt you since you are a n00b. ^ |:)[/QUOTE] Low post count says nothing about knowledge. Also see [URL="http://www.programmingforums.org/thread15369.html"]this thread[/URL]. | |
Re: This isn't really a VB question but a system administration question. Remove all those programs from the Start menu and any shortcuts that may be on the window. Its not completly foolproof but might reduce the chances that those products are accessible to the normal computer user. | |
Re: Is this a C or C++ program? You have a mixture of the two header files. It looks like mostly C so I'm moving it into the C board. | |
Re: You need to create a new [b]mat[/b] object inside that function, add the two matrixes parameters together then return it. I think this is a good candidate to use the throw statement if the two matrices can not be added. [code] mat operator + (mat &m1,mat &m2) // mat is … | |
Re: Tackle this problem one small step at a time, don't get overwhelmed and attempt to do it all at once. Start out very simply, with int main() and create a 2d char array that represents the rows and columns. Get that to compile without errors and then move on to … | |
Re: line 20: fflush() is only defined with output streams such as stdout. What you have is undefined behavior. Since the line about is an output line maybe you meant to use stdout instead of stdin. either line 21 or 26 will work, as well as this: [icode] fgets(section_1[tally1].first_name, sizeof ((PATIENT_DATA*)0)->first_name, … | |
Re: If you have XP on C: and Vista on D: then you don't have to reinstall anything. Just boot up on XP and reformat the d drive. The only problem I see with that is that you will still have the duel-boot menu. You need to edit the boot.ini file … | |
Re: >> return x[(count2)+1]; the above is on the inside of the loop so the loop will only run once. >>for (count = 0;count <= 20;count++) this loop will count one too many times. the array only has 20 elements but the loop will run 21 times. | |
Re: line 189: add getchar() to make the program stop and wait for input. | |
Re: most likely 2) your fault. You are probably not using the same compiler and/or operating system that the program's author used. Post a link to one of the programs so that we can take a look at it. And what compiler/os are you using? | |
Re: you need two variable -- highest and lowest. Initialize them to be the value of the first array element. Next code a loop to count from 1 to the number of items in the array, then test each array element against those two variables, and change the variable value to … | |
Re: I would start by reading a whole line at a time, then checking to see if it contains a space(s) and number at the end. if it does then set variable [b]size[/b] to that number and read that many names. >>dynamicArrayClass myArray(size) That won't work because it will allocate only … | |
Re: use two '' characters similiar to how you did it in the open statement. [icode]out << "Some Text" << "\\" << '\n';[/icode] | |
Re: line 168: two problems: 1) doesn't look like malloc() was everf called to allocate space for name. That will most definitely crash the program. 2) you are passing a pointer to a pointer in that function. Remove the & because [b]name[/b] is already a pointer. | |
In IE6 there was a menu File --> Open. That doesn't exist in IE7, or I can't find it. So I resort to using Windows Explorer and double-click on the *.htm file I want to load. Anyone know how to do it like IE6 ? Or a better way (in … | |
Re: >>How do u define a 2by 5 array..is it mean Yes you are right. >>how do u figure out how many elements in the array? first dimension times second dimenson. Very similar to a chess board where there are 8 rows and 8 columns, which means there are 64 squares. … | |
Re: The value of [b]level[/b] is never getting incremented, so after the program executes [icode]level--;[/icode] the value of [b]level[/b] is -1. And -1 is not a valid number to use for indexing into arrays or to be passed to [b]validity_check()[/b] Learn to use your compiler's debugger so that you can easily … | |
Re: Something like this might work: you need std::string with its find() and substr() methods. read the entire word into one std::string object start loop locate a comma use std::string's substr() to extract the word from position 0 up to the comma now use std::string's find method to see if it … | |
Re: You are seeing all that garbage on the screen because the program is printing more array values than what was read from the file. In your example, 30 * 30 is 900, not 10,000, so the loop should stop at 900. You need to save the counter from line 17 … | |
Re: [QUOTE=VernonDozier;553414]To add numbers to your lines, simply do this: [noparse] [code=C++] // paste your code here [/code] [/noparse] [/quote] Not supposed to use c++ any more. use cplusplus instead of c++. | |
Re: I think you have to write a CGI program using C, C++ or some other language. Whatever you use you have to write out the entire page using HTML markup language. | |
Re: You have to know the file format before it is useful to you. The link that stupidenator posted will show you how to use the FILE to read a file, but that is useless if you don't know the details of what the file contains. | |
Re: you are close -- just leave out the [b]i[/b] -- do not specify the number of words but let the compiler figure it out from the number of initializers. And BTW this is NOT an array of pointers but an array of std::string objects. There is a huge difference. [code] … | |
Re: Ohhhhhhh! I have to buy that for my auto CD player :) :) :) | |
Re: >>char filename[27]="c:\B2B Data\files\file.txt"; your compiler should have issued a lot of error messages about that line. Never ever ignore errors or warnings (in your own code) Most of the time, like the above line, warnings are actually errors waiting to crash your program. |
The End.