2,045 Posted Topics
Re: Do you have freedom in your class design that you could instantiate it within the Form1.h code and pass your form1 in as a parameter to the constructor? (or better yet whatever individual UI components you needed instead of the whole thing) | |
Re: This is really a C program, which should be in the C forum. You wanted to stay on "AT&T Boulevard" but take a left on Ritchie Street instead of taking a right on to Stroustrup Lane. Try dropping a `getchar();` statement at the end of the program before your return … | |
Re: Welcome. Please read the following [url]http://www.daniweb.com/forums/announcement8-2.html[/url] After you've looked it over and brought some code to the table, we'd be happy to help you with it. | |
Re: It's defined on line 166 of [url]http://fxr.googlebit.com/source/lib/libz/zconf.h[/url] (same library different site) which is included in zlib.h which your file includes. It checks for this STDC value which I assume means whether the system supports standard C. It seems to expand to a prototype of the functions. I know precious little … | |
Re: Select Win32 console project if you did not already. If you haven't create a new project for Win32 Console. Leave empty project unchecked and uncheck precompiled headers. See if any or all of that helps :) (Also make sure it built correctly with no errors, though it sounds like you … | |
Re: Topi is on the right track I think. A portion of it has to do with your preprocessor directives. I've never seen one with a period in it and this is why I suppose. Most people use an underscore in place of the period (the convention is to name it … | |
Re: I agree with firstPerson. However, I'm confused as to why this function marches along initializing some of the array members and then stops. You are asking it to "get" an element but returning a whole array. Unless you are doing some error checking that isn't evident in your code why … | |
Re: Firstly, use fgets to obtain your name string from the user. See [URL="http://http://www.cplusplus.com/reference/clibrary/cstdio/fgets/"]this[/URL] for a reference (it's a C++ site but it should be nearly the same). Next look into [URL="http://www.cplusplus.com/reference/clibrary/cctype/"]ctype.h[/URL] and there's a function tolower() that will help you if you don't know whether the text is in caps … | |
Re: [code] using namespace System::Collections::Generic; //at the top of Form1.h //here are the details of my little stub just to give you a ready test //program (I don't know what your specific requirements for the // LVI are so I just cobbled it into a button event. ListViewItem ^ lvi = … | |
Re: Write out what the loop would be printing for a 2x3 case [code] mat[0][0], mat[0][1], mat[0][2], mat[1][0], mat[1][1], mat[1][2] Your 2x3 counter would be 0 1 2 3 4 5 [/code] So how do you get 0 to be [0][0], 1 to be [0][1], etc, 5 to be [1][2] All … | |
Re: Well more than likely your program is going to be doing some event driven stuff (reacting from a button getting clicked, text changed in a textbox). Just to test out the concept put a button from the Toolbox onto your form (or whatever your gui need is),go over to Solution … | |
Re: I'm assuming you are using VC++ ? Go up to Project/"Your Proj Here Properties"/Configuration Properties/Debug/Command Arguments and put something for it to print out (separated by spaces). If you're not using VC++ then just put some arguments after your exe name when you are running it. "myexe -parameter1 -parameter2" (you … | |
Re: See [url]http://www.embedded.com/story/OEG20020429S0037[/url] (it happens to be an embedded article but it still applies). When you are passing parameters to a function they are not guaranteed to be evaluated from left to right, right to left or any other order. I tried it on 2 different compilers (VC++ 2008 Express and … | |
Re: The first backslash is an escape character, just like when you type \n you are escaping the character n and qualifying that it's a newline. So say you had for example mydir[B]\n[/B]ame in your directory string (or any string for that matter) you then have to escape the \ character … | |
Re: In case you need some references: [url]http://en.wikipedia.org/wiki/Gaussian_elimination#Pseudocode[/url] [url]http://en.wikipedia.org/wiki/Pivot_element#Scaled_pivoting[/url] What code do you have so far? | |
Re: If you're looking for OCR [url]http://www.simpleocr.com/[/url] Otherwise [url]http://www.google.com/#hl=en&source=hp&q=C%2B%2B+Twain&aq=f&aqi=&oq=&fp=b36c7832dbb01be6[/url] I have not used any of these SDKs so I cannot speak for their quality or content. | |
Re: Try something like this. The true passed to ReadKey() suppresses the output of the character to the screen. [code] ConsoleKeyInfo a; do { a= Console.ReadKey(true); switch(a.Key) { case ConsoleKey.O : Console.WriteLine("You ordered an orange"); break; case ConsoleKey.A: Console.WriteLine("You ordered an apple"); break; //etc. } } while(a.Key != ConsoleKey.E); [/code] Since … | |
Re: Try popping in a %20 for the space "C:\\Program%20Files\\Microsoft\\Exchange%20Server\\Bin\\eseutil.exe\" Having the path in quotation marks should take care of that but it seems like in your other example it's truncating based on the space. | |
Re: Take a look at this thread:[url]http://www.daniweb.com/forums/post246417.html#post246417[/url] Substitute ':' for ',' in the delimiter of the second getline call and you should have what you need (minus fixing it to work with your arrays,etc). You can use an N x 3 array for holding the strings or just do your parsing … | |
Re: Is this [code] Player one can enter your coordinates for X 2 1 | | X | X | O ____|____|____ | | X | X | ____|____|____ | | | O | O | | N spots 0 DRAW [/code] the condition you are talking about? | |
Re: Line 34: It's case sensitive so it needs to be Tests_Weight (or change all the others to match Tests_weight ;) ) | |
Re: Combine this: [url]http://en.wikipedia.org/wiki/Gaussian_elimination#Pseudocode[/url] And this: [url]http://en.wikipedia.org/wiki/Pivoting#Scaled_pivoting[/url] I strongly suggest that you sit down with pencil and paper and work out an example step by step, writing down what you are doing (e.g., I'm multiplying row 1 by a factor of a and added it to row 2, etc. etc. Then … | |
Re: See this: [url]http://www.velocityreviews.com/forums/t291617-std-cout-and-null-character-pointer.html[/url] (scroll down to post #6). I was looking for the reference in the standard [URL="http://www.slac.stanford.edu/BFROOT/www/Computing/Environment/Standards/C++/cd2/lib-iostreams.html#lib.iostreams.requirements"]here[/URL] but I couldn't find it directly. It seems that passing the null pointer to cout causes the badbit to be set and the output stream invalidated. So that bit would need to … | |
Re: You shouldn't have to clear it out, in fact you want to save it for your totaling and output at the end. When you are incrementing i you are getting the next struct from your array when the flow comes back to the top of the while loop. Maybe I'm … | |
Re: [code] i = 0; while (fin >> x[i] ) { i++; if( i ==n) //less than elegant but it's off by 1 if you && it in break; //to the loop condition } [/code] What you had was going out of bounds over and over --->fin >> x[n]; (n=20 is … | |
Re: Write out the class declaration (i.e., what you would put in the header file, [icode] class fractionType{//your declarations here }; [/icode]) and pinpoint specific areas that are giving you trouble. Try it on your own first, then search around in this forum for "rational class","fraction class", "operator overloading fraction." | |
Re: See [url]http://www.cplusplus.com/reference/clibrary/cstring/strcmp/[/url] for strcmp. You need to include <cstring> and your strings you are comparing need to be cstrings (so like the char * variety). You can get strings of this format from your C++ strings by using the c_str() method of any string object [icode] mystring.c_str() [/icode]. EDIT: You … | |
Re: I would add another dimension to your array, e.g.: [code] char answers2[5][4][2] = {{{'1','2'},{'1','2'},{'1','2'},{'1','2'}},{{'1','2'},{'1','2'},{'1','2'},{'1','2'}},{{'1','2'},{'1','2'},{'1','2'},{'1','2'}},{{'1','2'},{'1','2'},{'1','2'},{'1','2'}},{{'1','2'},{'1','2'},{'1','2'},{'1','2'}}}; [/code] (has all 12s but you get the idea) or you could use an array of strings to accomplish the same thing (leave it as 2D). You have a '10' in your array which isn't a … | |
Re: I am able to get it to compile, minus a total variable that appears out of nowhere and some cin's that had the << operator instead of the >> (I guess I caught your code before you changed it). It was balking about the signature of the setSales function not … | |
Re: genre should be of type songCategory in your struct instead of string. Then your other code should work. Also, you do not need to specify the =0, =1, =2etc in the enum itself since those are the default values so you can have enum songCategory {ROCK,ALTERNATIVE, etc,etc} | |
Re: I'm not absolutely clear on what you are trying to do with the atoi on that line 39. toUpper only works with one character at a time so you'd have to go through each element. The errors you pasted in at the top don't seem to have anything to do … | |
Re: Try Ctrl-Alt-F7 or Rebuild from the Build menu. | |
Re: You're either going to have to be much more specific regarding the aspects of the problem that you are researching or post your code (preferably both). | |
Re: Check out the partial keyword:[url]http://msdn.microsoft.com/en-us/library/wa80x488.aspx[/url] I think it's exactly what you need. | |
Re: Firstly, please use code tags the next time: `//code here` It makes it much easier to read and maintains the indentation properly. So first thing is get rid of the `return main()` statement. It doesn't do anything. When you complete this while loop you're back in main anyway. There's also … | |
Hey all, I'm usually over in the C++ forum most of the time but I had a question that's been lingering for a while. I've got Windows Vista 64. I use Kaspersky AV, 2009 (v. 8.0.0.454,latest DBs) and about 3 months ago the Windows Security Alert (Red Shield with X) … | |
Re: Anytime you are passing in (type a[]) to a method the call is converted into (type *a) where the array is passed in by pointer. I don't believe there is much of a workaround. If you need your original array intact, copy it memberwise into another array and keep that … | |
Re: Why do you have an extra set of parentheses on the end of your function prototype? Get rid of those and put a semicolon at the end. Also, you probably want to pass in ifstream by reference: void a(ifstream & b) in your prototype, nothing extra required in the function … | |
Re: Though check this out (it's for C) [url]http://code.google.com/p/nativeclient/[/url] (I originally heard about it from [URL="http://cplus.about.com/b/2009/08/11/running-c-code-in-your-browser.htm"]here[/URL]) so others have had the same idea. | |
Re: I had to look this up so I'm not much good on further questions :) [icode] String ^ kpath = gcnew String(argv[1]); [/icode] It makes sense to me but I don't have much experience with the CLI syntax. | |
Re: You can declare an array dynamically: see [URL="http://www.fredosaurus.com/notes-cpp/newdelete/50dynamalloc.html"]this[/URL] for a good example. However, if you have been taught vectors there is virtually no reason [I]not[/I] to use them (I could see a case where you had a requirement for very very low overhead). The vector will expand automatically if the … | |
Re: [url]http://www.cplusplus.com/reference/iostream/manipulators/setw/[/url] (it may be right justified by default, I've forgotten) [icode] cout<<setiosflags(ios::right)<<setw(10); [/icode] [url]http://www.cplusplus.com/reference/iostream/manipulators/setprecision/[/url] [icode]cout << setiosflags(ios::fixed) << setprecision(3);[/icode] and be sure to [icode] #include <iomanip> [/icode] | |
Re: [quote] dont use black screen please [/quote] I'm not sure what you mean by that. No one is going to write the program for you, and definitely not with Borland anyway. Instead, we will help you with what you have coded. In starting out, you should have an array of … | |
![]() | Re: Hint: Only use the outer for loop to control the lines, use the inner for loop to control the number of stars on each line. So therefore, you only need to put in the line breaks at a certain point. |
Re: What code do you have so far and what difficulties are you having with it? | |
Re: I'm not sure I understand why Maximum is a string? If it is you can't use the < with it. This is one of those things that within that loop you need to have a variable called maximum (an int) and one called maxteam(a string), you can test each incoming … | |
Re: Based on your specification, you'll need to revamp your code a little bit to use a structure. So you'll need it outside of main() like: [code] struct rainfall_data { int amount; string month; rainfall_data(string monthname){month = monthname;} //you can read anything on class constuctors too because they are //virtually identical … | |
Re: Try something like this: [code=c++] for (int i = 0; i < row; i++) { cout << "\nPlease enter the numbers for the "<<(i+1)<<" row: "; for (int j = 0; j < column; j++) { cin >> myArray[i][j]; } } [/code] | |
Re: Well, what is that brace on line 29 closing? Nothing. Your other for closes on line 12. Is there some kind of brace matching in whatever editor you are using? You can use that to run through them. Also, more importantly, you can't just use << with arrays. You need … |
The End.