2,045 Posted Topics

Member Avatar for kenny21

What have you tried so far? Have you tried out an example with paper and pencil to get the thought process (which makes it much easier to code)? Also please see this: [url]http://www.daniweb.com/forums/announcement8-2.html[/url]

Member Avatar for peter_budo
0
161
Member Avatar for Chrisjj

Do a quick net search for "given an infraction." It's a widely used, do I dare say, idiom. Language revolves around usage. From a practical standpoint, in the scheme of things it probably does not matter one bit.

Member Avatar for diafol
0
783
Member Avatar for restrictment

Go to the designer in your application and click on the Form1 window (or whatever you named it). Go to the properties menu on the right (if it's not there go to View/Other Windows/Properties Window. Click on the lightening bolt to get to the events. Go to load. Double click …

Member Avatar for jonsca
0
214
Member Avatar for arsshaw

Next time please use the code tags [noparse][code] code goes here [/code][/noparse] Why do you declare choice after you try to write to it? You need to move [icode] int choice = 0;[/icode] before [icode] std::cin >>choice; [/icode]

Member Avatar for arsshaw
0
414
Member Avatar for nikc121

You have to make a decision based on the options Lerner gave you in the last paragraph. At this point there is no right or wrong answer. At that point make a function skeleton like: [code] return_type myfunctionname(type param1,type param2) { } [/code] See how much of it you can …

Member Avatar for WaltP
0
267
Member Avatar for mbrinkley
Member Avatar for mbrinkley
0
234
Member Avatar for Instinctlol

Use a stringstream object: [code] #include <sstream> //... stringstream ss; double value = 10.4567; ss<<value; string valuestr = ss.str(); [/code] There are certainly other methods that will work but this one is more straightforward IMHO.

Member Avatar for jonsca
0
68
Member Avatar for RayRay1

EDIT: Ignore the other part about ostream. Since n and d are private members, you must access them through some kind of "getter" function. If they were public you'd probably want something more like r.(*n) instead of the way you have it (you can't dereference r as it is not …

Member Avatar for Lerner
0
679
Member Avatar for jmartis

Looks like there are a couple of methods. I didn't play around with it much further than this: [code] array<Point>^ ptarray = gcnew array<Point>(3); ptarray->SetValue(Point(0,0),0); ptarray->SetValue(Point(1,1),1); ptarray[2] = Point(2,2); [/code]

Member Avatar for jmartis
0
85
Member Avatar for daino

You're not too far off. With c-strings (strings terminated in '\0' as opposed to std::string which I'll get to in a minute) the variable is essentially a pointer, so saying [code] char * str1 = "Hello"; //a '\0' is automatically appended at the end of each of these char * …

Member Avatar for Stefano Mtangoo
0
233
Member Avatar for nur222

[quote],use "b"and"d"variables for base and decimal respectively. [/quote] Wow, well... if you've gotten [I]that[/I] far with it then by all means. I was kind of thinking of going with b for decimal. I'll have to go redesign...

Member Avatar for jonsca
-2
38
Member Avatar for makubexiii

I don't have any experience specific to this area but a search over at [URL="http://ieeexplore.ieee.org/Xplore/guesthome.jsp"]IEEE Explore[/URL] turned up quite a few results. You can read the abstracts and usually find the author's website if something interests you (the articles without a subscription are costly, unfortunately).

Member Avatar for jonsca
0
108
Member Avatar for Lukezzz

I have done this in C# but it seems to be a bit different in C++/CLI. I found [URL="http://stackoverflow.com/questions/1565142/what-is-the-simplest-way-to-display-and-change-an-image-resource-on-a-wpf-dialo"]this page[/URL] which describes a method but I don't know if it's the most effective.

Member Avatar for jonsca
0
107
Member Avatar for tquiva

On line 11, you're adding the same value (one past the end of the array, not what you want) over and over again. You want to add [icode] a[i] [/icode]. Double check your for loop there too, count the number of elements that loop will step through.

Member Avatar for jonsca
0
509
Member Avatar for salgaby

void getProbsPerSet(int probsPerSet) should be void getProbsPerSet(int & probsPerSet) to pass in the reference to your variable. The way you had it your cin >> value was falling into the vortex. There are a lot of things in the rest of it that I'm not honestly sure what you are …

Member Avatar for salgaby
0
198
Member Avatar for chandruswami

I was able to get something like this to work: [code] string value = "a, ,b,-,c,d"; string[] text = value.Split(','); //change it to a list List<string> texlist = text.ToList(); texlist.RemoveAt(i); //use a loop and the RemoveAt() method [/code] I couldn't find a way to do it on the array directly …

Member Avatar for thines01
0
185
Member Avatar for Justin9825

You have a kind of hybrid declaration/definition there on 22 which is incorrect. Change it to look like a method definition without the ; and with (). Of course add any parameters to the method that you need.

Member Avatar for Salem
0
126
Member Avatar for naseerhaider

[QUOTE=caut_baia;1200990]You should use a switch statement [code] char letter; while (cin>>letter) { switch (letter) { case 'd': case 'D': case 'e': case 'E': //code here break; } } [/code][/QUOTE] There are two different variables in the OP's if statement, your approach will not work.

Member Avatar for chiwawa10
0
135
Member Avatar for mmgoicochea

A quick hint. In the function that starts on line 38 you create one file stream, then create another, only open a file in the second one and then try to write to the first one. It's ok to be frustrated but take a step back and ask if what …

Member Avatar for mmgoicochea
0
122
Member Avatar for tomtetlaw

Use a 2D char array to hold the lines. This works best when you know roughly how many lines and how many characters in each line. Then use fgets to read them into the array one by one.

Member Avatar for caut_baia
0
85
Member Avatar for serena5

[QUOTE=serena5;1201820]Oh trust me if there was such a book, I would have found it by now, lol. [/QUOTE] If you're also looking into designing IDEs that you can use with an existing compiler check out [url]http://damieng.com/blog/2007/11/08/dissecting-a-c-application-inside-sharpdevelop[/url] -- the book is free and legal.

Member Avatar for jonsca
0
676
Member Avatar for mbrodie

Make a list of string arrays and add them to the list in the order that you add the classes to their combobox. Note in this case that comboBox1 is your classcmbo and comboBox2 is the other one. [code] List<string[]> strlis; public Form1() { InitializeComponent(); //add your class strings to …

Member Avatar for kvprajapati
0
170
Member Avatar for rowley4

[QUOTE=tonymuilenburg;1201051]Ah, I see you just got the bracket in the wrong place. There is also a comma after int that should not be there. Here it is cleaned up: [CODE] //... cout << endl; } return 0; } void DivideArray(int table[6][5], int theMatrix[6][5], int, int) <----- { for (int i=0; …

Member Avatar for jonsca
0
135
Member Avatar for blind122

When you are entering a char it's causing the input stream to go bad. I would think clear() would take care of it but I wasn't able to get it to work. There's got to be some other trick to it that I'm not aware of. The simplest solution is …

Member Avatar for caut_baia
0
93
Member Avatar for lewashby

If you hit the set button and then you hit the calculate button it's going to set bags of feed to 5 (see your button2_click handler). In order for the program to change farmer.NumberOfCows on line 28 of the first file you must move the numeric up/down to a new …

Member Avatar for jonsca
0
70
Member Avatar for Lukezzz

Check to see if it's still running somewhere (if it's not in the taskbar, open the task manager and see if it's still there, end the process if it is). Failing that try rebooting. If that still doesn't help you might have to create a new project and incorporate the …

Member Avatar for green_frog
0
5K
Member Avatar for barbjones7

I think you need a slight redesign. Perhaps I'm misunderstanding your intentions but you are making an array of 20 strings but each entry will take up 6 of those strings. You'll only have 3 records. I would make a list of string arrays that are each 6 elements long. …

Member Avatar for bravo659
0
431
Member Avatar for chathuD

Put in a [icode]cin.get();[/icode] at the end of your code, before your return statement in main(). If the get() is being falsely triggered by an excess character in the stream, put in a [icode]cin.ignore()[/icode] before the call to get().

Member Avatar for chathuD
0
87
Member Avatar for iammfa

[QUOTE=iammfa;1200443]Hi, my code: [CODE]#include <iostream> #include <iomanip> #include <conio.h> //leave this out, it's nonstandard using namespace std; void main() { int i=32; for(i=32; i<=256; i++); //something extra on this line cout << setw(0) << "value" << setw(14) << "character" << endl; cout << setw(0) << i << setw(10) << static_cast<char>(i) …

Member Avatar for jonsca
0
129
Member Avatar for iammfa

The key part of the assignment was make a function. You have thrown all of your code into main(). Make it a separate function that you can call in main(). Double check your formula for A with a calculator. Also, you did not use the M_PI constant, you wrote your …

Member Avatar for jonsca
0
1K
Member Avatar for #define
Member Avatar for jwenting
0
159
Member Avatar for brettbed

Hint: use the method [URL="http://msdn.microsoft.com/en-us/library/system.string.isnullorempty.aspx"]String.IsNullOrEmpty()[/URL] You may want to change around your for loop into a while or do/while loop. You could use either of those structures to make sure you have at least 1 item in each and keep re-prompting if you don't.

Member Avatar for brettbed
0
581
Member Avatar for Jeff_5_7

[QUOTE=Banfa;1195916]You can not compare fractions unless they have the same denominator. If they have the same denominator then you can simply compare the numerators.[/QUOTE] If they don't have the same denominator you can multiply denominator of the 2nd by numerator of the 1st and then denominator of the 1st by …

Member Avatar for Banfa
0
263
Member Avatar for tinanewtonart

Don't start a new thread I just replied to your other one... n doesn't exist in your class, you need the number value, see next sentence. Make a getter method for your card class that returns the value. Make a second method that returns the suit if there is a …

Member Avatar for peter_budo
0
2K
Member Avatar for trippinz

Try something like this: [code] string concat=""; foreach (Control ct in Controls) if (ct is TextBox) concat = (ct as TextBox).Text + "\r\n"+concat; //this puts a CRLF in between each YMMV [/code] (It seems that the foreach is iterating through the controls backwards -- I double checked that they were …

Member Avatar for trippinz
0
66
Member Avatar for tskellyfla

[QUOTE=Software guy;1197029]I think this program is really easy, I tell you why: When the user inputs the data forexample hours , minutes and seconds. It is possible to convert that into angles. On calculators there is special button to do that as well. You can check this link below and …

Member Avatar for jonsca
0
193
Member Avatar for Duki

Add the directory that the lib is in under Project, Properties, Configuration Properties, Linker, Additional Library Directories and add the name of the lib into Project, Properties, Configuration Properties, Linker, Input, Additional Dependencies. When debugging you may have to set the Project, Properties, Configuration Properties, Debugging, Working Directory to the …

Member Avatar for jonsca
0
101
Member Avatar for Joonhwa Yang
Member Avatar for thousandpimps
0
4K
Member Avatar for Mz3g

Have you named your executable the same name as some other system software? It doesn't seem like your code has any error message like that. Try renaming your program.

Member Avatar for Mz3g
0
174
Member Avatar for tonymuilenburg

Do you have the AcceptsTab property of the textbox set to true? I was able to get it using [code] private: System::Void textBox1_KeyDown(System::Object^ sender, System::Windows::Forms::KeyEventArgs^ e) { if(e->KeyCode == Keys::Tab) MessageBox::Show("Tabbed!"); } [/code]

Member Avatar for tonymuilenburg
0
306
Member Avatar for ana12
Member Avatar for Lardmeister
-5
256
Member Avatar for Graphix

See [URL="http://www.daniweb.com/forums/thread268865.html"]this recent thread of cwarn23[/URL]. It's got an administrator response on there from Happygeek.

Member Avatar for diafol
0
174
Member Avatar for diafol

IMO, you could have a system where posts on threads over 3 months old require moderator permission. It's more work in the short term but having to take the time to approve 5 threads rather than having to close 20 for the usual spam,"I have a totally unrelated problem but …

Member Avatar for diafol
1
716
Member Avatar for kodera

[QUOTE=kodera;1196102]This is just the beginning of my name sort prog... I am starting with just reading in the names and then outputting each name... As of right now, it is crashing after displaying the first name... I think it's something with my array.. rectangular, instead of square, but don't know …

Member Avatar for jonsca
0
71
Member Avatar for tquiva

Line 22 should be [icode] rad = input*pi/180; [/icode] (since pi rad = 180 degrees) (also cos(2*pi) = 1 not 2) I didn't check your series approximation but see if that fixes it first.

Member Avatar for jephthah
1
305
Member Avatar for collinisaac

You can concatenate the variables right onto a string: [code] double pi = 3.14159; int i = 3; MessageBox::Show(pi+" rounded down to the nearest integer is "+i);[/code] If the object is not of one of the fundamental datatypes (int, double, etc) you will need to call it's ToString() method. The …

Member Avatar for jonsca
0
112
Member Avatar for yznk

Look at line 94: [icode]for ( ndeps=0; fin >> buffer && buffer[0] != '-'; ndeps++); [/icode] There's one thing that's missing there and one thing that's extra. You need to declare ndeps as an int (since the other ndeps in the program is unrelated making the global variable is definitely …

Member Avatar for Stefano Mtangoo
0
192
Member Avatar for Lukezzz

You ought to be able to use a picturebox, the contents of which you can probably get as a stream from the web, go from a stream to an image. Were you planning on writing the text onto the banner directly? If so you could have a label that you …

Member Avatar for Lukezzz
0
133
Member Avatar for jephthah

Ok, I didn't regret clicking on that nearly as much as I thought I was going to. Save up, buy the real stuff, nuff said.

Member Avatar for Will Gresham
0
95
Member Avatar for chipbu

[QUOTE=ddanbe;1193265]Change your constructor private Dictionary<char, int> alphabetList = new Dictionary<char,int>(); into private Dictionary<int, char> alphabetList = new Dictionary<int,char>(); Because a Dictionary constructor first has a Key type and then a value type. [/quote] I think the OP wants it like he has it because he wants to keep counts of …

Member Avatar for ddanbe
0
1K

The End.