2,045 Posted Topics

Member Avatar for mangualmanuel13

Rather than working from a clean slate, post up the code that you have now. It's unfortunate that those other forums didn't meet your needs, but you're coming across as a little bit demanding. I know that you don't know everything, but in order to help you, rather than do …

Member Avatar for jonsca
0
184
Member Avatar for Karkalash

Mixing cin and getline like you do can cause problems. Since you press enter after entering in userInputString and cin does not take up that resulting '\n', it stays in the stream and gets taken up by the getline (and interpreted as the end of the input, so control appears …

Member Avatar for Karkalash
0
132
Member Avatar for epew23

[code] int get.a(a); [/code] is not correct, and shouldn't be associated with the getcoefficients() method. The period indicates a member variable and shouldn't be used in a method name like that, just make it [icode] int get_a or geta etc. [/icode] Also, your notation is incorrect (it looks a bit …

Member Avatar for jonsca
0
662
Member Avatar for gl7

See the example on the bottom of this page [url]http://www.cplusplus.com/reference/stl/vector/erase/[/url]. You'll have to add an offset to .begin() to index in. So to erase the 6th element [icode] vectorGameList.erase(vectorGameList.begin()+5);[/icode]

Member Avatar for gl7
0
155
Member Avatar for xCrusade

Your romanNum in main is just one character. I'm assuming you're going to want to convert more than that. setRoman is incorrect, you have no variable name for the parameter and it doesn't really do anything. If you are using C-style strings, look into functions in the <cstring> header like …

Member Avatar for xCrusade
0
1K
Member Avatar for yeahyeah85

Take in product code as a string rather than an integer, and then verify that all of the characters in the string are digits. Just as an aside, why are you passing in the value for product code into the function if you're just going to ask the user to …

Member Avatar for jonsca
0
185
Member Avatar for VasquezPL

Before you start to do it all by hand, take a look at something like this [url]http://msdn.microsoft.com/en-us/magazine/cc163991.aspx#S3[/url]. There are mechanisms in place for internationalization of your application and you can keep the strings right in the ResX file now, rather than using an external config file. Otherwise, split the strings …

Member Avatar for jonsca
0
283
Member Avatar for gavGaz

You never reassign bodyPos[c] [I]to[/I] bodyPos[a], there should be a third line to your swap on line 6-7.

Member Avatar for jonsca
0
79
Member Avatar for jackmaverick1
Member Avatar for poloblue

I hate to tell you this, but you're going to have to narrow the code down dramatically and present questions about specific sections because someone is not going to go through and check all those steps for you.

Member Avatar for poloblue
0
2K
Member Avatar for Smithy566

dynCurrentTime->Now is a handle to a DateTime object? (DateTime ^) or? If not, I would just declare a regular DateTime object: [code] DateTime time1,time2; time1=dynCurrentTime->Now; etc. [/code] Then you can use the overloaded < > == operators.

Member Avatar for jonsca
0
2K
Member Avatar for halleluijah

[icode] Console.WriteLine(prime.ToString() + " - Prime"); [/icode] You left your C# hat on... :) Only kidding. He/She also needs to check the numbers to see if they are palindromes too. OP was trying to just check the first and last digits but for a 4+ digit number this will probably …

Member Avatar for pyromania
0
276
Member Avatar for Lemonader

Is your assignment to write the solver or simply to solve that set of equations? If it's the latter, just use [url]http://www.mathworks.com/help/techdoc/ref/rref.html[/url], it's essentially doing the same thing by a slightly different method.

Member Avatar for Lemonader
0
1K
Member Avatar for GamerDJX

[quote]amirite?[/quote] No, because you're not always going to have someone to take you through a project step by step before you have to do it. You likely have a textbook and certainly have the internet if you don't know how to do something. No one is going to give you …

Member Avatar for jonsca
0
165
Member Avatar for electrox73

Look into a DateTime object: [url]http://msdn.microsoft.com/en-us/library/system.datetime_members(v=VS.90).aspx[/url] Create an instance of a DateTime object and set it equal to DateTime::Now, then just use the hours, minutes, seconds members to get what you need. If you want it to update every second, use a Timer object.

Member Avatar for jonsca
0
303
Member Avatar for negneg

You're going to have to write out the error messages because most people don't know the error codes off the top of their heads.

Member Avatar for jonsca
0
202
Member Avatar for VanHackman

I was just playing around with it, but in case you're interested [url]http://www.codeproject.com/KB/cs/DraggableForm.aspx[/url] also works (you need to change the Point * (as it's old) to regular Points to get it to play nice. Glad you found a solution

Member Avatar for jonsca
0
718
Member Avatar for Awesumlewy

If you are doing plain C++, you should select a project of type Win32 Console application, rather than a CLR/console. Otherwise it's going to be more of a hodgepodge than necessary (unless you are really looking for that functionality). Check the "number" to see if it's less than 20 (using …

Member Avatar for richieking
0
173
Member Avatar for CanaznFTW

[quote]- Compiling in Terminal [/quote] What is the command you are using to compile? You need to put both .cpp files in the command. [icode] g++ myclass.cpp mymain.cpp -o myprogram [/icode] (assuming you're using gcc).

Member Avatar for CanaznFTW
0
4K
Member Avatar for kas04

The numbers you are looking for are surrounded by spaces (or in the last case by space and the end of the string). If you hit a space and the next digit is a number, start converting until you hit another space(or the end of the string).

Member Avatar for jonsca
0
2K
Member Avatar for jinx0007

Please put some code tags on your post. There's still time to edit. Click the Edit button underneath your name and surround your code by [noparse][code]//code here[/code][/noparse].

Member Avatar for jonsca
-1
99
Member Avatar for Chellam2

Just to throw this out there: what if you read all the data for one car into a List<string> and added that to a List<List<string>>? Add the first member of each list (the VIN) to the combobox, then use the SelectedIndex of the combobox as your index into the List<List<>> …

Member Avatar for jonsca
0
221
Member Avatar for prog_newb

[quote]anyone here? [/quote] Please have some patience, the person who ultimately answers you question may be sleeping now. Have you run this function through a debugger to see exactly when it crashes?

Member Avatar for jonsca
0
179
Member Avatar for DaniwebOS

Is the number of test scores something that you can prompt the user for? If so, use a dynamic array: [code] std::cin >> numscores; int * scorearray = new int[numscores]; [/code]

Member Avatar for jonsca
0
127
Member Avatar for Kath_Fish

Make sure the textbox is set to multiline. To append your text to what is in the box, use the += operator. In your loop: (obviously read the line of text into a temporary if you're using .ReadLine() to drive the loop) [code] myTextBox.Text +=(myStreamReader.ReadLine()+"\r\n"); [/code] I didn't test that …

Member Avatar for jonsca
0
94
Member Avatar for Dani
Member Avatar for jon.kiparsky
0
210
Member Avatar for VernonDozier

This is a good thread on SO about it: [url]http://stackoverflow.com/questions/628526/is-short-circuiting-boolean-operators-mandated-in-c-c-and-evaluation-order[/url] Both are short circuiting, so since your first operand of || was true, it skipped the foo() call in the first example.

Member Avatar for Ancient Dragon
0
176
Member Avatar for sajidtariq

[quote]So that 'AC' becomes (('A' - 'A' + 1) * 10) + ('C' - 'A' + 1) which is 10 + 3 = 13 [/quote] Except that AC is actually 29 (after Z comes AA, AB, AC, etc.), so for AA to be 27, A has to be 1 (you'd …

Member Avatar for Ancient Dragon
0
179
Member Avatar for bkoper16

Glancing through, it didn't seem like anyone has pointed out to you yet that [code] if (200 <= sales[i] <= 299) [/code] should be [code] if(sales[i] >=200 && sales[i] <=299) [/code] The first version may compile as a statement, but it isn't going to resolve properly. The same for your …

Member Avatar for jonsca
0
775
Member Avatar for Frostyyy

This [icode]int getMetaData( int dataFlags[], int dataSize);[/icode] is making another prototype of your function in main, and (I believe) overshadowing your prior definition of it). Go back and look over your text as to how to call a function properly (hint, you don't need the data types in the call …

Member Avatar for jonsca
0
124
Member Avatar for FrancisLazo

Keep a running total in a double variable. Add the ticket price into that total within each of the cases of the switch statement, like right after you set the seat to reserved (note that you want to make sure that you're only charging once per ticket). In other words, …

Member Avatar for FrancisLazo
0
118
Member Avatar for emreozpalamutcu

He's using .NET (C++/CLI). OP, you should specify this (at least that you are using a Winforms project). MSDN has great pages on all of the controls. You'll find that you need to change the BackgroundImage (and probably the BackgroundImageLayout). [url]http://msdn.microsoft.com/en-us/library/system.windows.forms.picturebox(v=VS.100).aspx[/url]

Member Avatar for emreozpalamutcu
0
633
Member Avatar for salvador01

You're not returning anything in your function, which is supposed to return an int, so any information in c_charg is lost. Also, where does area come from? You need to declare this in the function and calculate it with the length and width that are being passed into the function. …

Member Avatar for jonsca
0
90
Member Avatar for drumboy354

With your project open, go to the Project menu, <ProjectName> Properties, Configuration Properties, C/C++, Additional Include Directories, and add in where your header files reside. Then also under Configuration Properties, Linker, General, Additional Library Directories, add the directory where the libraries reside. Then Configuration Properties, Linker, Input, Additional Dependencies, add …

Member Avatar for tamoghnaroy
0
146
Member Avatar for sandersfm

Why do you have more than one main()? See if you can organize these around one main, and then someone can help you figure out how to fill in the blanks.

Member Avatar for sandersfm
0
155
Member Avatar for aaronmk2

It's choking on reading the true or false values. When reading a bool from a file it's looking for a 0 or (EDIT: only works for 1) a 1 as false and true. Read in "true" or "false" from your file as a string and then convert it to boolean …

Member Avatar for jonsca
0
157
Member Avatar for Alice1990

If there are less than 10 choices, take in the choice as a character rather than an integer. Check to make sure the character is between '1' and '9' (or '0' and '9' if you want a choice 0). Alternatively, if a 2+ digit answer is required, take in the …

Member Avatar for jonsca
0
318
Member Avatar for jream1

Note that it's "endl" with an 'L' Take in your X and Y (you can't read into a algebraic relation like X+Y), also note that "x" as an identifier is different from "X". Do the program a step at a time. Firstly, make sure your include directive is complete (you're …

Member Avatar for jonsca
0
175
Member Avatar for silverpanda

I'm assuming you are required to use the c-strings? Check out strtok [url]http://www.cplusplus.com/reference/clibrary/cstring/strtok/[/url] (using the comma as a delimiter) Also, [U]never[/U] use gets(), you can overrun the buffer by a mile and corrupt the neighboring memory. Use fgets instead so that there is a fixed buffer size.

Member Avatar for jonsca
0
387
Member Avatar for pupucashu

If you had specified a size for the vector in main, what you did could work, but since it starts off with an unspecified size you can't index into it. [code] string tempstring; while(i < MAX && in >> tempstring) { str.push_back(tempstring); i++; } [/code] You should also pass the …

Member Avatar for jonsca
0
427
Member Avatar for VasquezPL

Create a DateTime object and use comparisons( <. >,==, etc.) with the current date: [code] DateTime vernalequinox(2011,03,21); DateTime summersolstice(2011,06,21); //or whatever it is if(DateTimePicker->Value >= vernalequinox && DateTimePicker->Value < summersolstice) MessageBox::Show("Spring!"); [/code] I'm not very familiar with CEST and CET, but I assume they change over on certain dates. You …

Member Avatar for VasquezPL
0
378
Member Avatar for tomala90

What is contained in the input file? Also, your function from 55 onwards doesn't have a return type, name, or parameters.

Member Avatar for jonsca
0
291
Member Avatar for ezat2020

There is no standard functions to do this. You will need a library like OpenCV (or possibly something in DirectX, though I'm not sure of that). If you are just starting in C++, it may be too complicated to dive right into getting something like that to work with your …

Member Avatar for ezat2020
0
195
Member Avatar for C++ newb

[quote]Also I'm using VC++ for this.[/quote] I assume you're using a CLR/Winforms application? Check out [url]http://www.daniweb.com/forums/post1126074.html#post1126074[/url]. There's some extra info in there pertaining to troubleshooting that particular case, but note the classes and the setting that the OP used.

Member Avatar for jonsca
0
95
Member Avatar for jmace

I'm assuming you're using a CLR/Winforms setup. If so, see [url]http://www.codeproject.com/KB/IP/httpwebrequest_response.aspx[/url] for a good example (the example's in C#, so you'll have to convert the syntax, subbing :: for the C# . that indicates namespace resolution and -> for the . that indicates member variable). HttpWebRequest is the class that …

Member Avatar for jmace
0
230
Member Avatar for edrag

On line 1 of your second code listing of the first post, you still need the datatypes for str and level in the constructor definition [code] dragon::dragon(string str,int level) { [/code]

Member Avatar for writerervin
0
1K
Member Avatar for watery87

I'm not as familiar with strtok, but you should try passing in [icode] line.c_str() [/icode]to it instead of the address of the first character on line 14. What you did assumes something about the implementation of the std::string which may not be true. Either way, you seem to be getting …

Member Avatar for mike_2000_17
0
162
Member Avatar for reemhatim

You're making life difficult on yourself: Define a variable max, set it equal to the first element of the array Step through the array, if the current element in the array is greater than max, let max be equal to that element, and set temp = index. Only change the …

Member Avatar for reemhatim
0
145
Member Avatar for AutoPython

Yes, you would want a dynamic allocation. In C++, a fixed-size array's size must be a constant known known at compile time. You need [icode] int * myarray = new int[sizeofarray]; [/icode] Since the array is dynamically allocated with new, you need to delete it to free up the memory, …

Member Avatar for jonsca
0
166
Member Avatar for brendeg

Use strcmp in the <cstring> header. You can't compare two C-strings using ==. [code] if((strcmp(string1,string2) == 0) cout<<"Strings are the same"<<endl; [/code] Easier would be to use cin.get to read in a character and compare it to 'Q'

Member Avatar for WaltP
0
504

The End.