2,045 Posted Topics

Member Avatar for daianahoney

Where is the code for the overloaded operator? Please make some attempt at that code and post back.

Member Avatar for daianahoney
0
239
Member Avatar for custurd122000

The first few errors are due to the fact that you don't have a constructor that takes an argument. In [I]addition[/I] to what you have: You need a constructor that takes an int argument. (in your class declaration): [icode] MyStack(int sz); [/icode] and defined as: [code] MyStack<T>::MyStack(int sz) { top=-1; …

Member Avatar for jonsca
0
288
Member Avatar for Saddi

[quote]What is the partations of c++?[/quote] Please clarify what you mean by "partations". [quote]What kind of programmes I can built with?[/quote] Go through some open source projects and see what languages they use. Something like [URL="http://en.wikipedia.org/wiki/Category:Free_software_programmed_in_C%2B%2B"]this[/URL] can give you some idea [quote]And why it's the best programming languages?[/quote] That's a …

Member Avatar for jonsca
0
119
Member Avatar for superjj

Go to the designer and select your form. Go over to the properties window and select the lightning bolt (to get the events). Find "Form closing" (not "Form closed") and double click the cell to the right of it. This will put the event handler code into your Form1.h and …

Member Avatar for superjj
0
134
Member Avatar for fclopez

You are trying to read "RXBytes" into one character (since you are using %c and rec is just a character). I would read the whole line in using fgets and copy out/parse the portions that you need based on the fact that your have an equals sign, followed by a …

Member Avatar for jonsca
0
484
Member Avatar for anitaNg

Line 28: [code]newNodePtr->pengarang = pengarang;[/code] You are only copying the pointer over, not the contents of the string. Use [icode] strcpy(newNodePtr->pengarang,pengarang);[/icode] instead (or better, since you don't know how large your source string is, use [URL="http://www.cplusplus.com/reference/clibrary/cstring/strncpy/"]strncpy[/URL]).

Member Avatar for jonsca
0
144
Member Avatar for CaptainProg

Those sorts of low-level direct I/O calls (in the spirit of inp()/outp()) no longer work under Windows (as of NT and later) without a special device driver. For an alternative look into the Win32 API functions like [URL="http://msdn.microsoft.com/en-us/library/aa363858(v=vs.85).aspx"]CreateFile[/URL]. See [URL="http://www.robbayer.com/files/serial-win.pdf"]this PDF[/URL] as the author seems to go through those functions …

Member Avatar for CaptainProg
0
3K
Member Avatar for cafegeo

What was the code that you were using for the bubble sort, and where did you place it?

Member Avatar for cafegeo
0
472
Member Avatar for jingda
Member Avatar for jingda
-2
72
Member Avatar for Tinee

I ran it through a couple of times: [code] Is the ohm a decimal? Enter Y : y Please enter 0 first then the decimal point. (Ex. 0.1) Please enter the desired resistance value in ohms (0.01 ohms to 100,000,000 ohms): 1.0 Please enter the desired tolerance as a percentage(5, …

Member Avatar for mike_2000_17
0
134
Member Avatar for sciprog1

Not to interject now that this is solved, but give chapter 35 of the C++ FAQ (particularly [URL="http://www.parashift.com/c++-faq-lite/templates.html#faq-35.12"]question 12[/URL] a read. It's one of the clearer explanations I've run across.

Member Avatar for sciprog1
0
148
Member Avatar for narunaru

Hint: "one" is at position 0 of the Manta array, "two" is at position 1, etc.

Member Avatar for Dexxta27
0
118
Member Avatar for clickspiker23

I would just eliminate that parameter, as you are creating a new ifstream object within the body of the method anyway. You may want to rethink your implementation a bit, because all you are doing is writing to the same int value over and over again, and that int is …

Member Avatar for jonsca
0
139
Member Avatar for Mr. K

Have a look at [URL="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=4411BBFC-0E3C-42B3-BD05-AF1D292C986F"]this[/URL] (there's a nicer version for VS 2010, it's probably virtually the same set of keybindings).

Member Avatar for pseudorandom21
-2
250
Member Avatar for andimiami

On line 64, you are attempting to parse the data without having any data yet. Put your getline statement first (before your parsing statement), then put a statement to split your string in two (into first and last), and then finally call [icode] parse2() [/icode].

Member Avatar for Greywolf333
0
135
Member Avatar for munitjsr2
Member Avatar for jmcginny5

I have a question as to why you are displaying in your add method. Your add method should do nothing more than add the two numbers together. You may want to check with your specification to make sure that your code is not supposed to add the two together and …

Member Avatar for TrustyTony
0
222
Member Avatar for hawita

[quote]Why not declare a string empty val and input it in between t[lcv] and Z[lcv] to achieve the spacing? [/quote] The extraction operator (>>) takes input delimited on spaces. The way the OP has it is fine.

Member Avatar for jonsca
0
190
Member Avatar for Ancient Dragon

[QUOTE=frogboy77]The money's not the best [/QUOTE] Everybody always says that, but they forget that there are just so many perqs beyond the salary (not to mention all the book deals and speaking engagements afterwards are probably enough to keep them afloat). I'll bet the president doesn't pay for internet and …

Member Avatar for e-papa
1
331
Member Avatar for Theisonews

Use an ifstream object and the extraction operator >> to get the values. As you read them in, loop over the members of your array and write them in. Take another shot at it and post back if you are still having trouble.

Member Avatar for Theisonews
0
471
Member Avatar for TheSassyDragon

Have you tried compiling it? There's quite a few syntactical liberties in there. :) [code]char[]* LongArr;[/code] is not valid syntax. Where does numStr in the constructor come from? Where does i come from in [icode] getInt() [/icode]? [code]new int* int1[/code] new doesn't belong on the left side of that expression …

Member Avatar for Lerner
0
290
Member Avatar for sha11e

[quote]C# is foor n00bs[/quote] Be sure and let [URL="http://stackoverflow.com/users/22656/jon-skeet"]him[/URL] know that. ;)

Member Avatar for sergent
0
213
Member Avatar for pritpal.singh88

[code]char *text;[/code] You have an uninitialized pointer here, and a few lines down, you try to store something in it. Allocated memory for your C-string using new. Why do you close the file before you open it in the beginning of the code?

Member Avatar for jonsca
0
111
Member Avatar for geekme

You need to be much more specific about your requirements before anyone can even begin to help you. Since you only have 1 week, you're going to have to be conservative about your goals, as some of these libraries take months to learn.

Member Avatar for Kanoisa
0
212
Member Avatar for ronthedon

Did your instructor go over passing parameters by reference. You need those techniques in this case. For instance, the getName signature would look like: [code] void getName (string & firstName, string & lastName) [/code] Otherwise, you are just passing in copies of those variables, the changes are being made, and …

Member Avatar for jonsca
0
180
Member Avatar for kucing

[quote]When I want z value to write in Textbox form window.[/quote] That doesn't happen by magic. Go through [url]http://www.functionx.com/vccli/general/introprogramming.htm[/url] which will tell you a little about accessing GUI elements. You'll have to make sure you have the right kind of project selected (winforms). In addition, the syntax of the (loose) …

Member Avatar for jonsca
0
237
Member Avatar for cse.avinash

[QUOTE=cse.avinash;1530546]Sir, you can check the link:- [url]http://www.spoj.pl/problems/SIZECON/[/url][/QUOTE] (I'm going to weigh in, even though I probably shouldn't) OP, what you have written is not legal syntax, it doesn't compile, and either you misunderstood the solution explained to you or the person explaining it to you had no idea what they …

Member Avatar for cse.avinash
-1
553
Member Avatar for geekme

Try starting a new project and copying and pasting the code from the existing one into the new one.

Member Avatar for hag++
0
77
Member Avatar for p.user01

[quote]Better you must read it properly.... [/quote] Better you reread the thread because you don't seem to understand the clear explanation that Narue was giving about undefined behavior.

Member Avatar for WaltP
0
312
Member Avatar for newbie14

In readFile, first you use std::string and then you use C-strings. You should pick one and be consistent. If your concern is getline there is a version that is a member method of istream ([url]http://www.cplusplus.com/reference/iostream/istream/getline/[/url]). Also, line 35 will not work.

Member Avatar for newbie14
0
318
Member Avatar for chess2009
Member Avatar for jonsca
0
116
Member Avatar for royng

College seemed tough at the time, and in many ways I wouldn't want some of that pressure back, but really I'd give anything to be back to the good times. I'll take the wisdom I've gained in the (runs hand over my mouth to conceal the number) years since I've …

Member Avatar for HiHe
0
565
Member Avatar for Osas106

Check out Curl (standalone program) and libcurl (C library which has C++ wrappers) [url]http://curl.haxx.se/[/url] However, you can interact with a database directly from your C++ code (using whatever bindings your database has, or a generic ODBC driver), so there's no need to interact through the web server.

Member Avatar for jonsca
0
131
Member Avatar for KazenoZ

By virtue of C# being the more prevalent .NET language, most of the tutorials don't use the C++/CLI syntax. You're better off looking at a C# site like [url]http://www.c-sharpcorner.com/Articles/ArticleListing.aspx?SectionID=1&SubSectionID=167[/url] and trying to translate the syntax (sticking in :: and -> when needed).

Member Avatar for KazenoZ
0
224
Member Avatar for pseudorandom21

What /clr setting do you have set for the compilation? If you don't have any on there, it will try to compile your code as native.

Member Avatar for jonsca
0
127
Member Avatar for BobFX

[quote] I'm not familiar with C#[/quote] All you have to remember is that C# used '.' for both namespaces (which would use '::' in C++) and member variables/methods (which would use either '.' or -> to access a class/struct depending on whether the variable is a pointer or not). I …

Member Avatar for BobFX
0
475
Member Avatar for shyla
Member Avatar for shyla
0
1K
Member Avatar for hawita

Do you know how to do all of the transformations from a mathematical standpoint (i.e., pencil and paper)? If not, first start with a good reference book or Wikipedia article and figure out the mechanics of it.

Member Avatar for jonsca
-1
121
Member Avatar for emanfman

Put it in a file named something like "ParseBBCode.h". Include that header in your Form1.h file (or put it in stdafx.h, but that's not necessary). You do not need to include <string>, the String ^ in this case is a System::String^ from .NET. You will either need to put a …

Member Avatar for emanfman
0
317
Member Avatar for gla41247

At least show us something you've started. You have the pseudocode there, now try and transform as much of it as you can into actual C++ code.

Member Avatar for Fbody
0
351
Member Avatar for sosongetsu

Sure, someone will be glad to help, but please make some attempt at those two functions. No one is going to write it for you. I know you said you "messed up," but that's what we need to see to get you going in the right direction. Start with the …

Member Avatar for WaltP
0
2K
Member Avatar for honamc

[quote]is it possible?[/quote] Yes. I'm assuming you're using C++/CLI with Winforms? Place your images in a [icode]List<Bitmap>[/icode] and make a "surrogate" array of integers from 0 to 15. Use a [URL="http://en.wikipedia.org/wiki/Knuth_shuffle"]Fisher-Yates shuffle[/URL] on that array of integers. Display the items of the list in the order that is defined by …

Member Avatar for jonsca
0
104
Member Avatar for salty11

You need a loop. The way your function is situated now, you call it by passing in the array without knowing how many members it has,which doesn't actually matter because you're printing out the first element, incrementing i and then returning. "i" is not maintained between calls, so you're starting …

Member Avatar for salty11
0
429
Member Avatar for Ravenn

I'm assuming that you're working in C++/CLI since you are doing WinForms. Check out the [URL="http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx"]BackgroundWorker[/URL], as I believe that's the most straightforward way of getting a separate thread (and I believe it was designed for exactly this purpose, i.e. for separating the GUI and the meat of the code). …

Member Avatar for jonsca
0
254
Member Avatar for jingda

[quote]i can just include a welcome speech at the end of my post.[/quote] Put it in your signature. "If you're new, welcome, if you're returning, welcome back, and if you're here all the time, you're WaltP" :)

Member Avatar for jingda
0
198
Member Avatar for sdr001

[quote]I am not for sure if addresses.push_back(ads);, in the code below, will make the above possible. [/quote] Can you clarify what you mean by this? Your code is confusing because you have [icode]ads.push_back(name);[/icode] and then [icode] addresses.push_back(names);[/icode]. Did you mean names instead of ads in the first part? It seems …

Member Avatar for sdr001
0
185
Member Avatar for jowana

[quote]giving a vertex on a 2D plane[/quote] What information do you have about the plane? (equations, points, etc?) [URL="http://en.wikipedia.org/wiki/Surface_normal"]This[/URL] does a nice job of explaining things.

Member Avatar for jowana
0
119
Member Avatar for SWEngineer

Grab #7 (it's free and legal) from [url]http://www.qtrac.eu/marksummerfield.html[/url]. #6 is the current edition, but I don't know how much that is. The book takes you through making a rudimentary spreadsheet within the first few chapters. It also goes on to talk about the other aspects of the library like the …

Member Avatar for SWEngineer
0
230
Member Avatar for Fortinbra
Member Avatar for feligak
1
197
Member Avatar for Deepo

Make a list for yourself of precisely what is confusing about those topics, for example [code] Typecasting: Is it necessary to cast my variable when I am doing XYZ Twos compliment: How do I handle negative numbers [/code] etc. Now you have a list of things you can search other …

Member Avatar for jonsca
0
222

The End.