2,045 Posted Topics

Member Avatar for Craftknight

t=0 should be t==0 (the first assigns 0 to t, the second checks for equality), etc., but in this case since t is a double, it is tough to compare with 0 or 1, etc, due to the inexact representation of doubles. What does your data file look like?

Member Avatar for Craftknight
0
154
Member Avatar for HASHMI007

[quote]how to passs strutre to an arry[/quote] Aside from having to strain my eyes to read that, what do you mean? How to make an array of structs?

Member Avatar for jonsca
0
91
Member Avatar for programing

What is the range of numbers in your data set? Make an array the size of your largest element. If you have 0-9, make an array of ints,"counts", that is size 10, and initialize each element to 0. If you encounter a number, increment that digits place in the array …

Member Avatar for WaltP
0
2K
Member Avatar for bantex07

Read in the lines one by one and write out the ones you want to keep into a new file. Please post what you have tried so far.

Member Avatar for jonsca
-1
61
Member Avatar for LevyDee

I don't have any insights into your problem, but I'm curious about something. Doesn't the compiler complain on line 14 that lwFile isn't a [icode] const char *[/icode]? Normally the fstream objects take a C-string (so you'd need [icode] lwFile.c_str() [/icode] in that spot instead).

Member Avatar for Kanoisa
0
148
Member Avatar for Igor Vinícius
Member Avatar for Igor Vinícius
0
156
Member Avatar for DaniwebOS

[quote=Zjarek]In minus one day you can get negative day, and in function toname you only treat properly positive idx.[/quote] He's exactly right. What happens when idx is negative, your method toName runs right off of the end. At the end of toName, put something like [icode] return "junk"; [/icode]. You'll …

Member Avatar for jonsca
0
108
Member Avatar for Seattle Slim

@OP I think they've only been answered occasionally, but people have posted Obj-C questions in both C and C++. So, there are higher traffic forums, besides MD, for posts about that topic.

Member Avatar for jon.kiparsky
2
392
Member Avatar for Swift2
Member Avatar for Swift2
0
206
Member Avatar for ashrafu1

That's a very long piece of code to ask someone to go through. Try to narrow down a specific region where you think the problem is occurring (you have your loop with the menu at the top, try to figure out why control is not reaching that point again). Try …

Member Avatar for ashrafu1
0
483
Member Avatar for andimiami

[quote=??]you can use the /t and /n in your output [/quote] I believe he means '\t' (for tab) and '\n' Go with what Moschops recommends (a related command is found [url]http://www.cplusplus.com/reference/iostream/manipulators/setw/[/url])

Member Avatar for andimiami
0
220
Member Avatar for VasquezPL

See this article: [url]http://www.codeproject.com/KB/exchange/Exchange2007EWS-Part1.aspx[/url]. I think you should be able to add the dll as a reference in C++/CLI and just adopt the syntax.

Member Avatar for VasquezPL
0
451
Member Avatar for Danny1994

You're going to have to create a class that inherits from ListView and play with the underlying mechanics to get it to do what you want. Here's an example of doing it in VB ([url]http://www.vbforums.com/archive/index.php/t-145805.html[/url] I know it's the wrong language, but that value that they cite is probably what …

Member Avatar for jonsca
0
128
Member Avatar for Vindal

Remove the =0.03 from the declaration (line 11). balance is a parameter of enterAccountData(), so it goes out of scope once that method ends. Use accountBal in computeInterest() instead.

Member Avatar for jonsca
-1
166
Member Avatar for subith86

A variable in a local scope with the same name as a global variable overshadows that variable. cows in farm1 is incremented locally but then destroyed when the function finishes. Try removing line 5 and see what happens. P.S. It's considered a bad habit to use global variables (except in …

Member Avatar for mike_2000_17
0
189
Member Avatar for Khoanyneosr

Use ignore with no arguments, which will default to skipping 1 '\n' (you don't want the space like you have it)

Member Avatar for Khoanyneosr
0
132
Member Avatar for LevyDee

Just use the other version of getline: [code] getline(*streamReader,headerInfo); [/code] [quote]string is simply a char array correct?[/quote] I'm not an expert on this sort of thing, but I think the std::string class code could be implementation dependent, so I don't know to what extent you can rely on it being …

Member Avatar for LevyDee
0
103
Member Avatar for sheennave

Try changing line 3 to [icode] ClientResolution = Screen::GetBounds(this->ClientRectangle); [/icode] You need to give GetBounds a rectangle or a control so it can give you back the resolution of the screen showing that object, so give it the rectangle of the form.

Member Avatar for sheennave
0
217
Member Avatar for caut_baia

I've remained reticent on this issue because I have dealt with the original poster in the past. He knows I that became the most irate when he banged out a solution to a problem and pasted it into the box, usually leaving no explanation. He underestimates the fact that any …

Member Avatar for caut_baia
0
370
Member Avatar for MixedCoder
Member Avatar for Jennifer84

ToolStripMenuItem has a "Tag" property (I think all of the controls do) which you could use to store the URL. Rather than generating an event handler for each new URL, make a generic one that navigates to the URL in the tag. What is the nature of the error when …

Member Avatar for jonsca
0
165
Member Avatar for shauzi158
Member Avatar for floatingDivs
0
222
Member Avatar for helbirah

Do you have a line like [icode] cin >> somevariable;[/icode] up above that point? There's probably a stray newline left in the stream from where you pressed enter during the cin operation. [code] int i; string str; cin >> i; //enter in 10 + <enter>, 10 goes into i getline(cin,str); …

Member Avatar for jonsca
0
121
Member Avatar for L3gacy

You want a function like strcat instead of strcpy in that case (the M$ "safe" equivalent is [url]http://msdn.microsoft.com/en-us/library/d45bbxx4(v=vs.80).aspx[/url] strcat_s. strcpy by nature just clobbers whatever is there.

Member Avatar for L3gacy
0
4K
Member Avatar for Dani

Even though it may not be related to what you are changing, I'm going to assume it is: voting/rep system doesn't seem to be working in C or C++.

Member Avatar for ~s.o.s~
0
214
Member Avatar for gerard4143

Try out the Mark Summerfield free one ([url]http://www.qtrac.eu/marksummerfield.html[/url], Qt4 version, first edition). It's not bad. The first few chapters he takes you through creating a "spreadsheet" application. That part may be too basic for your needs, but he then goes through the rest of the library (including all of the …

Member Avatar for gerard4143
0
113
Member Avatar for fazdhli

What are you expecting it to print? Can you narrow it down to a small section that's not working?

Member Avatar for jnawrocki
0
184
Member Avatar for eduard77

[QUOTE=adn295]hi i think you have overloaded ">>" operator so that compiler gets confused about which operator should be matched exactly with that operand since >> is a built in operator so you should not overload it. Hope this will clear your confusion...[/QUOTE] Wait, what? The issue is that your prototype …

Member Avatar for jonsca
0
187
Member Avatar for Harley_Quinn

Please post what you have thusfar and indicate some specific areas in which you require the most help.

Member Avatar for jonsca
0
183
Member Avatar for Jennifer84

Look into .NET Reflector (a legal program that has a free version). It's normally used for C# and VB, but there seem to be some add-ins for C++/CLI that are out there (I've never used any of them, so I can't attest to their validity). You're probably better off trying …

Member Avatar for Jennifer84
0
121
Member Avatar for SWEngineer

Have one of the files from the project selected, then under Project/Properties/Run-Debug Settings/Launch Configurations for '<yourproject>' select your exe file (so probably needs to be built before editing this, but I don't know). Then edit and select the arguments tab.

Member Avatar for jonsca
0
44
Member Avatar for java-utm-stg

I think the function you are looking for is fread (the parameters are in a slightly different order, see [url]http://www.cplusplus.com/reference/clibrary/cstdio/fread/[/url]). AFAIK, read is an iostreams method from C++.

Member Avatar for jonsca
0
344
Member Avatar for VasquezPL
Member Avatar for VasquezPL
0
46
Member Avatar for chess2009

[quote]But I have recieved any answe yet .[/quote] Be patient, this is something that is going to have to be looked into by a moderator. One may not be available presently.

Member Avatar for Ezzaral
0
367
Member Avatar for Shodow
Member Avatar for GregPeters

When passing in a 2D array you must specify the second dimension in the parameter: [icode] void PrintArray(int array[][2],int n);[/icode] I should point out that the size of a fixed sized array must be known at compile time, so what you are relying on is likely a compiler extension and …

Member Avatar for txwooley
0
229
Member Avatar for VasquezPL

If you're going to instantiate your array outside of one of the methods (Load, Click, etc.) it must be static. The constructor of the form is a good place to instantiate it, but leave the declaration of it right where it is. I've heard (though I've yet to get my …

Member Avatar for jonsca
0
1K
Member Avatar for Sherry.K

Whew, it took me a while, but I think I've got it. Your turn. (at least post what you have so far so someone can help you with your code)

Member Avatar for VernonDozier
-4
599
Member Avatar for anu07

There may be some non-standard functions to do so in TC++, but I would just try to open it using an fstream object then use the .is_open() method to make sure that it has opened successfully. That's kind of quick and dirty, as I'm sure there are different OS dependent …

Member Avatar for anu07
0
413
Member Avatar for bart89

You can also call [icode] Invalidate();[/icode] anywhere within your code to force the Paint() method to run.

Member Avatar for jonsca
0
89
Member Avatar for VasquezPL

[icode]comboBox1->SelectedIndex[/icode] will give you the zero-based index of the item you've selected. Probably you were just in a rush, but you want the == instead of = in your line of code above.

Member Avatar for VasquezPL
0
156
Member Avatar for fazdhli

It would be nice to know what the error was that you are running into. The formatting on this code is terrible. Give [url]http://www.gidnetwork.com/b-38.html[/url] a read.

Member Avatar for fazdhli
0
104
Member Avatar for blee93

Use a debugger (or pepper it with cout statements) to see how far it gets in execution. If you can't find it after that, post back and I'll compile it.

Member Avatar for blee93
0
233
Member Avatar for fazdhli

Which one do you actually want, this C++ version (which isn't in the right spot anyway) or the other C version? It's very confusing when things are posted that way.

Member Avatar for fazdhli
0
216
Member Avatar for rlamarche
Re: FIFO

[quote]Need a standard fifo algorithm[/quote] A std::queue would be a good abstraction to look into. I'm not sure how it's actually done, but you could probably look into dissecting the one that the Linux kernel uses.

Member Avatar for template<>
0
125
Member Avatar for george61

You probably don't need an array of strings. Just make a function that takes two strings as parameters. [icode] void isPalindrome(char * str1,char * str2) { }[/icode] Use the length of one to step backwards through that string while doing forwards through the other one.

Member Avatar for b56r1
0
110
Member Avatar for DaniwebOS

What are you trying to print out with "DayOfTheWeek.getDay"? That call would only work if getDay were a static member variable of DayOfTheWeek. Which line is the compiler referring to with the second error message?

Member Avatar for template<>
0
289
Member Avatar for FrancisLazo

I would learn to use arrays first, then functions. You can consolidate all of your tickets down to an array of characters (or eventually a std::string when you learn more about those).

Member Avatar for Red Goose
0
227
Member Avatar for Portgas D. Ace

I don't think I can say anything "constructive" here, but just imagine what I could have said. And thank you, I know.

Member Avatar for jonsca
1
80
Member Avatar for cross258

I think you are confused, [icode] string str[100] [/icode] is giving you an array of 100 std::strings. Is that what you want? Bear in mind that characters are just 1-byte ints, so they can be added to or subtracted from: [code] char c = 'a'; c++; std::cout<<c<<std::endl; //'b' c+=2; std::cout<<c<<std::endl;//'d' …

Member Avatar for cross258
0
461

The End.