1,857 Posted Topics
Re: It appears to me you're using deprecated functions with the new librairies. Searching the forums for SDL can give you more information. | |
Re: Pretty hard to find the problem without the complete code. | |
Re: Here's one way: void MakeInvTri(int rows, int spaces = 0) { static const char temp[21] = "* * * * * * * * * * "; static const char temp1[21] = " "; if (spaces == 0) { rows *= 2; } if (rows < 0) { return; } … | |
Re: Probably one of the easiest ways is by using the constructor: Add these lines to the `Stack` class public Stack() { } public Stack(Stack input) { arr = input.arr; } And use it like this: Stack st2 = new Stack(st); | |
Re: What code are you using and where is it going wrong? | |
Re: Firstly, your code as is shouldn't compile. * `fin >> 3;`- makes no sense. You can't can't extract an input stream to a constant value. * `int nof_row_per_mainnumber[3];`- this isn't spelled the same as where you use it, `no_row_per_mainnumber[i]= numberof_rows;` * The initial class block must end in a `;`. … | |
Re: First off, your prototypes that take parameters don't have any datatypes just variable names. Secondly, the functions you want to call, are already inside the class. You shouldn't need to declare new ones, just create an object of that class. | |
Re: Not sure if this is the problem, but you sem to be assuming 1-based indexing. Have you tried 0-based indexing of the spreadsheets? | |
Re: Feel free to post what you have. I woulkd suggest, though that if the code is lengthy and there are quite a few problems to break it down into several questions instead of one big massive one. This not only keeps the answers focused but also assists other members who … | |
Re: A conditional that checks the size of the `Lines` property of the textbox should work Dim PageElement As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName(TextBox1.Text) For Each CurElement As HtmlElement In PageElement TextBox2.Text = TextBox2.Text + CurElement.GetAttribute(TextBox3.Text) + Environment.NewLine If TextBox2.Lines.Length = 3 Then Exit For End If Next | |
Re: It would probably help if the headings on the web page were persistant and didn't scroll off the screen when you scroll down the web page. At least this way the notification would always be visible. | |
![]() | ![]() |
Re: You could use a stringstream. The extraction operator will use the space as a delimiter and you can extract the string, "new", and the number to separate variables. | |
Re: Been along time since I looked at VBScript but here's the link to the [VBScript User's Guide](http://msdn.microsoft.com/en-us/library/sx7b3k7y%28v=VS.85%29.aspx) which should have all the answers you need. | |
Re: Actually if you create a new form1 object in form2 and show it from there, you can access the combobox on form1 even after the form is closed. On a side note, you really should be able to show some code when you ask a question. | |
Re: A couple of other things: * They way you've interpreted the question means that your input number can't be more than 63, since a 64-bit integer(the largest most modern systems will recognize) will max out after that. It makes more sense to raise the input number to the power of … | |
Re: It's because `str` is a C-style char array and the last element is always a string terminator character. So `size-1` will return that character instead of the last character of the string. | |
Re: Actually Borland C++ 5.02 was released in 1997. Not quite 20 years but pretty darn close. [Code::Blocks](http://www.codeblocks.org/) with the GCC compiler is a pretty good choice, and has the advantage of being cross-platform. This means that you can copy your files over to your new computer if you decide to … | |
Re: What is the code doing that is wrong? One thing I've noticed, `f` is of type `FormA` but you're initializing it as a new `FormB`. | |
Re: If you research `c++ circular list` you'll find there are quite a few articles/posts/examples available. | |
Re: Based on what I can tell from translating your spanish, You're checking if the outstandingloan column is empty, then saying the customer has outstanding loans. I'm wondering if your conditional statement is reversed: If IsDBNull(dr("prestamopendiente")) Then prestamostatus = MessageBox.Show("Cliente no tiene préstamos pendientes. " & vbCrLf _ & "Favor proceder … | |
Re: Actually `PadLeft` only accepts char not string. Also you need to offset `i` by 3 otherwise the first couple of steps the figure walks in one spot: string head1 = " 0 "; string body1 = "!T!"; string legs1 = "/ \\"; string legs2 = " | "; bool legsShouldPrint … | |
Re: You haven't said where the problem is. Assuming it's the regex, you might find it simpler to just validate the string as a number: public bool IsValid(string text) { int temp; return int.TryParse(text, out temp) && temp >=0 && temp <= 100; } | |
Re: Two things that should help: * Add `#include "ClassOne.h"` to ClassTwo.cpp(allows you pass a ClassOne object to twoPrintsOne) #include <iostream> #include "classTwo.h" #include "ClassOne.h" using namespace std; ClassTwo::ClassTwo(int c, int d) { m_c = c; m_d = d; } void ClassTwo::printValuesTwo() { cout << "m_c: " << m_c << " … | |
Re: Is there a question in there somewhere? | |
Re: What code have you tried so far? | |
Re: According to the [help file](http://pubs.opengroup.org/onlinepubs/7908799/xsh/encrypt.html): > The block argument to encrypt() is an array of length 64 bytes containing only the bytes with numerical value of 0 and 1 | |
Re: Basically get rid of the `Redo:` and the `goto`'s,they indicate sloppy programming anyway, and replace them with return statements. Since the return type is Decimal, you'll have to figure out what number you want to use to signify an error. `-1` might do the trick. On a side note, rather … | |
Re: How is it not working? What results are you getting? Also, describing the code is not the same as submitting your code. Submit what code you have, and be specific about what exactly it is doing wrong. | |
Re: Aside from the design issues, the `showdata` routine only returns 1 char. You will probably find more success making the return type `char*` and passing the character array as the return data: char* showdata() { return data; } | |
Re: You need a method to force the user the press a key before the console is allowed to close. Here's a pretty good [article](http://www.cplusplus.com/forum/articles/7312/) that discusses the various options for that. In your case, since you seem to be using `c`, I would suggest this answer from that article: void … | |
Re: The search function is expecting an object of type `Empleado` not a string. list1->search(Empleado("DUDE010101R0", "Juan Peres")); list1->search(Empleado("AUDE010101R1", "Ana Banana")); Clearing this error brings you to: if(temp->data,data_) { cout<<"Element found " << temp->data; The `if` statement is illegal and `cout` doesn't know how to display `temp->data` | |
Re: One thing I noticed is that your algorithm is using the literal value of `char` instead of offsetting it by 48 to get the integer value represented by the char. | |
Re: Those kind of posts are what happens when you don't care enough to take the time to understand the [Rules](https://www.daniweb.com/community/rules), before you post a question. | |
Re: A binary search basically divides the collection in half, whichever half conatins the searched for item, that part is split in half again, and so on until only 1 item is left that equals the search term or the last 2 items that the search term falls between. A binary … | |
Re: The sorting should be pretty much the same as you use for the numbers. | |
Re: You will probably want to use a a container like a map which will take key/value pairs. The two letter combination is the key and the value is the count. | |
Re: Odd when I run your code, the only problem I find is the phone, being stored as a number means that it's displayed using scientific notation. Otherwise all the other data is displayed as entered. On a side note, create_account should be an external function that passes the data to … | |
Re: Your main problem is not having a loop to read through the file. For storing the totals a `map<string, int>` would work well. Read the file storing the totals in a map object. Now you can display whichever total is required. A simple menu would work well for that.: #include … | |
Re: Have you tried giving it a literal path instead of a relative path? | |
Re: Here's one way that uses on the fly searching: private void textBox1_TextChanged(object sender, EventArgs e) { foreach (ListViewItem item in listView1.Items) { //Selected = true, won't show until the listview has focus, but setting it to true puts it in the //SelectedItems collection. if (item.Text.ToLower().StartsWith(textBox1.Text.ToLower())) { item.Selected = true; item.BackColor … | |
Re: Your first step would to use the date property of the onDutyRecords instead of a separate DATE object. This will put the data for one line in one struct object. Something like this should work: struct onDutyRecords record; infile >> record.date.day >> record.date.month >> record.date.year; infile >> record.name >> record.sunshine … | |
Re: I think you're problem is opening the file in two modes at the same time. Try opening the stream one mode at a time and closing it before you want to switch modes. | |
Re: This[ Wikipedia Article](http://en.wikipedia.org/wiki/Bridge_pattern) offers a pretty explanation with diagrams and code examples that show what is meant by separating the interface from the implementation. | |
Re: Assuming you mean that you don't want a gap in the numbering. One way would be to loop through all the rows from the row you removed to the end and decrease the serial number by 1, for each row that's left | |
Re: Set the last element plus one to a value that won't be entered. For instance, if the values will all be positive, -1 will work. When you loop through the values to display them, exit the loop when you reach this value. | |
Re: What you probably want is a Hex Editor, which will read any file and display the data in hexadecimal,the format you've shown you want, and in ASCII. A good one will let you export the data as hexadecimal to a text file. | |
Re: It seems to me that you either need a default constructor for the `Adventure` class or initialize it according to the existing constructor. | |
Re: This should get you started: [How to: Host Controls in Windows Forms DataGridView Cells](http://msdn.microsoft.com/en-us/library/7tas5c80.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1) | |
Re: Basically you need 3 toolbars, one for each type of browser. |
The End.