5,676 Posted Topics

Member Avatar for kotkata

[QUOTE=logicmonster;1143033]How did you solve this? I'm having basically the same problem.[/QUOTE] What makes you think after two years this guy is just waiting around for you to ask this? If it's the same problem, try reading the thread and get the same help he got.

Member Avatar for WaltP
0
283
Member Avatar for foco

Opening a file requires a C-style character array, not a C++ string. [B]Jonsca[/B] has posted your answer. I just thought I add why.

Member Avatar for WaltP
0
105
Member Avatar for BlinkOnly

I suggest displaying all the values before and after you try the insert. Display the array, used, current_index, and any other variables that will help you figure out the problem. Run the code in the debugger is also a good idea.

Member Avatar for WaltP
0
162
Member Avatar for fux0r

You're welcome in retrospect. Why did you post this? What kind of response are you expecting? you didn't even ask a question.

Member Avatar for abhimanipal
0
115
Member Avatar for sgw

[QUOTE=logicmonster;1142914]cin.get() isn't doing anything, its just sitting in your code trying to look pretty and getting in the way :)[/QUOTE] Not if you run the program in an IDE. [QUOTE=sgw;1142917]Yes, after adding "flush", the output came out! Thanks! Been doing C++ for a long while but never noticed this problem. …

Member Avatar for ppl154
0
141
Member Avatar for ELBUF

[QUOTE=ELBUF;1142401]I think I can identify where the problem is, I just have no idea how to go about fixing it or even trying something different.[/QUOTE] Care to share where you think the problem is, or is it a secret?

Member Avatar for ELBUF
0
2K
Member Avatar for turrence27

[QUOTE=turrence27;1142882]1>d:\my documents\visual studio 2008\projects\idontknow\idontknow\ddd.cpp(13) : error C2228: left of '.Length' must have class/struct/union 1> type is 'int'[/quote] Since when does an [ICODE]int[/ICODE] have a [ICODE].Length[/ICODE] member? [QUOTE=turrence27;1142882]1>d:\my documents\visual studio 2008\projects\idontknow\idontknow\ddd.cpp(15) : error C2109: subscript requires array or pointer type[/quote] [B]CardNumber[/B] is an [ICODE]int[/ICODE], not an array. [QUOTE=turrence27;1142882]1>d:\my documents\visual studio 2008 …

Member Avatar for turrence27
0
2K
Member Avatar for DARK_BYTE

[QUOTE=DARK_BYTE;1142766] This line is supposed to cause that error: [CODE] myArray[count].address=line.substr((myArr[1]+1),(myArr[2]-(myArr[1]+1))); [/CODE] I can't understand why it says its out of range when the pos and length I supplied is valid.[/quote] Are you [I]absolutely[/I] sure? Maybe you need to print out all the values you are using just before the …

Member Avatar for Clinton Portis
0
110
Member Avatar for turrence27

You need to ask a question about what you don't understand. Not just post your assignment: 1) it looks like you want us to do it for you 2) we have no idea what you're having trouble with When posting, details are more important than posting the assignment.

Member Avatar for WaltP
-1
1K
Member Avatar for logicmonster

Consistent [url=http://www.gidnetwork.com/b-38.html][B]formatting[/B][/url] will solve these problems in moments.

Member Avatar for WaltP
0
177
Member Avatar for The Pobo

[QUOTE=The Pobo;1137372]Hey, I'm a student with rudimentry knoledge of VB6 and I've a college project where I have to develop a blackjack game. Unfortuanately I've a problem with the method I call the cards I was wondering if any of you would be able to shed some light on the …

Member Avatar for The Pobo
0
220
Member Avatar for Traicey
Member Avatar for MJaske

I don't see a problem. Maybe you should post the entire error, not paraphrase it. Wonder if it has to do with using [B]math.h[/B] instead of the C++ [B]cmath[/B]. I doubt it, but [B]cmath[/B] is the correct header.

Member Avatar for thomas_naveen
0
160
Member Avatar for cyberguy007
Re: game

Good job. nicely formatted code, but you used [iCODE]conio.h[/iCODE]. What grade did you get?

Member Avatar for anup375
0
90
Member Avatar for hwlibra083

Because you are expecting the language to do the work for you. When you read strings, [I]you[/I] need to deal with the strings yourself. And since we have no idea what you are reading and trying to do, it's hard to point you in a direction. You need to understand …

Member Avatar for hwlibra083
0
506
Member Avatar for cyberguy007
Member Avatar for Der_sed

As you loop through the equation, remember the position of each ( you see. When you see a ), extract everything between the ) and the last ( you saw. Replace these characters with SPACEs to clear out the extracted section. "Unremember" the ( location since it's no longer there. …

Member Avatar for WaltP
0
87
Member Avatar for yznk

[QUOTE=yznk;1141985]I fixed up my code some and now the program runs, but it crashes after entering the rows and columns. Im not sure why, why is it crashing and not finding the number of steps?[/quote] It crashes? Then it doesn't run, does it? :icon_wink: You should know by now that …

Member Avatar for jonsca
0
110
Member Avatar for Narue
Re: IRC

[QUOTE=Will Gresham;1115869]I have connected to the IRC a few times, but no-one is ever on when I do :)[/QUOTE] Makes sense. With the 8 or so people that use it, the chances that any one of them are on at the exact time someone enters the IRC is slim at …

Member Avatar for Nick Evan
0
281
Member Avatar for lismoker

With your lack of [url=http://www.gidnetwork.com/b-38.html]formatting[/url] I must be missing the [ICODE]for[/ICODE], [ICODE]do-while[/ICODE], or [ICODE]while[/ICODE] statements that start your loop

Member Avatar for Fbody
0
138
Member Avatar for its_yogy

[QUOTE=its_yogy;1141621]// Also i wud be happy to ...[/QUOTE] And we [B][I]would[/I][/B] be happy if you'd use CODE tags and [url=http://www.gidnetwork.com/b-38.html]format your code[/url]

Member Avatar for WaltP
0
303
Member Avatar for tefatany

We don't know where either, but there certainly is one missing. It all depends on what is part of your function and what isn't.

Member Avatar for WaltP
-1
26
Member Avatar for TheWolverine

In the same scope, yes. In different scopes, no. But it could be very confusing to anyone reading the code. Generally not in functions as you have them, though. Be careful if defining variables within code blocks ([ICODE]if[/ICODE], [ICODE]for[/ICODE], [ICODE]while[/ICODE], ect)

Member Avatar for Fbody
0
293
Member Avatar for leverin4

Look up the [ICODE]unload[/ICODE] or [ICODE]terminate[/ICODE] event handlers for your form.

Member Avatar for WaltP
0
83
Member Avatar for anthony5557

[QUOTE=anthony5557;1141037]Can anyone help me tweek my code. This program is supposed to get the day number 1 through 365 from the user and display the corresponding month and day. I'm getting so many errors I don't know how to start or really decipher the error in C++. [/QUOTE] Gee, my …

Member Avatar for Fbody
0
209
Member Avatar for Pugee

[QUOTE=VernonDozier;1141592][LIST=1] [*]Use code tags. [*]Is this a code snippet? You don't have it flagged as one. [*]If not, what's the question? [/LIST][/QUOTE] Don't mention Code Snippet! They are posting enough Code Snippets already that we have to edit! :icon_twisted:

Member Avatar for WaltP
0
107
Member Avatar for callister

[ICODE] for(int x=2; x<(number/2); x++)[/ICODE] Start a loop from 2 to [B]number/2[/B], incremented by 1 If [B]number[/B] is 10, loop through 2,3,4, [ICODE] {[/ICODE] [ICODE] while(number%x==0)[/ICODE] Another loop -- when the [I]remainder [/I]of [B]number/x[/B] is zero exit the loop [ICODE] number/=x;[/ICODE] Divide [B]number/x[/B] giving a new [B]number[/B] [ICODE] }[/ICODE]

Member Avatar for WaltP
-1
99
Member Avatar for london-G

Read the file line by line and when you get to the line you want, stop. Might need an [iCODE]if[/iCODE] statement

Member Avatar for wasyazwan
0
1K
Member Avatar for nsjoe
Member Avatar for WAIWAIWAI
Member Avatar for Notme

Look up the function [iCODE]isalpha()[/iCODE] and test each character after you read the line. Also, [url=http://www.gidnetwork.com/b-56.html]see this[/url] about gets(). And [url=http://www.gidnetwork.com/b-38.html]see this[/url] about formatting. Yours is not very good.

Member Avatar for Dave Sinkula
0
1K
Member Avatar for mahive

You start by choosing a language Look you the for loop Add code to support the loop

Member Avatar for WaltP
-1
63
Member Avatar for newcuser

You open the files in [ICODE]main()[/ICODE], you don't check if they opened properly until you've called your function. Bad form. Open and check immediately. That way you don't waste time and confuse your brain cells later. Then you use [ICODE]scanf("%s"...)[/ICODE] which is dangerous. [url=http://www.gidnetwork.com/b-59.html]See this[/url], then jump to Part 7.

Member Avatar for WaltP
0
171
Member Avatar for dchunt

Here's what I see: [code] std.open("std.txt"); if(std.is_open()) // Why are you doing this? { std.seekg(0, ios::end ); // Jump to bottom of file fstd = std.tellg(); } // If open failed, why are you trying to read? std.read(st,fstd); // You've jumped to the end of the file std >> st[n]; …

Member Avatar for WaltP
0
116
Member Avatar for EvilNerd

[QUOTE=EvilNerd;1140766]when i try it to add i and compile the code i got errors and warnings. And when i try to run the program it gives me an abort message with red x on it.[/QUOTE] Gee, since there are only about 2000 possible errors, all we can say is "you …

Member Avatar for EvilNerd
0
93
Member Avatar for jameslat

[QUOTE=jameslat;1140800]Hey everyone! this is my first post at this forum:P[/QUOTE] We know. It's in the header with your name... ;) [QUOTE=jameslat;1140800]Please go through and answer what question you can[/QUOTE] Sure. [QUOTE=jameslat;1140800]is anyone willing to help me?[/QUOTE] Yes. If you had actually asked some questions, this reply might be more useful. …

Member Avatar for jameslat
0
88
Member Avatar for dinamit875

[QUOTE=dinamit875;1139760]Hi, there, I have written a program here which shows plane to book a seat, and enter flight info(this part works fine)... but having some small problem here I am using gotoxy and it gives me an error, it says that gotoxy undeclared. Could anyone help me with this please, …

Member Avatar for dinamit875
0
356
Member Avatar for rom87

[QUOTE=rom87;1138381]hi Im trying to make this code go though every possible string combination at said string length though alpha characters using random number generator to do so.The goal is to make this program tell me how many combinations there are at said circumstances set by user.[/QUOTE] Said problem is confusingly …

Member Avatar for nezachem
0
138
Member Avatar for FreakNFlow

You have to deal with the array index and the loop index [B]i[/B] separately. Only increment the array index if -1 is not read. If you see the -1, do not increment the array index.

Member Avatar for Salem
0
267
Member Avatar for adcodingmaster
Member Avatar for adcodingmaster
0
209
Member Avatar for riotburn

First thing I see is using C-style headers and C input. Get rid of all the C headers ([ICODE]conio.h, stdio.h[/ICODE]) and stick with [ICODE]iostream[/ICODE]. With that, don't use [ICODE]_getch()[/ICODE]. Use C++ input commands. [ICODE]math.h[/ICODE] should be [ICODE]cmath[/ICODE], the C++ version. Fix that and if still a problem, describe in greater …

Member Avatar for jazz_vill
0
421
Member Avatar for johndoe444

[QUOTE=gerard4143;1140023]Is this me or does this look like C++ list<item_set> candidate_set;[/QUOTE] Nope. Not just you. Please clarify, [B]johndoe444 [/B]

Member Avatar for mitrmkar
0
97
Member Avatar for busybee2498

Nice! Question. Why did you resurrect a two year old thread asking a question that has no real relation 1) the the thread itself? 2) to the language the forum is about?

Member Avatar for Nick Evan
0
40
Member Avatar for techie929

[QUOTE=techie929;1140250]I have to create a bst in which i have to add string values in the nodes..I have to display the no of nodes inserted each time..When I insert small string like..FA or B...i am getting the correct value in count[count is the variable which I have taken to count …

Member Avatar for techie929
0
86
Member Avatar for themarval

You don't need a user defined header file for this program unless you make two .cpp files. hint #2- overloaded

Member Avatar for jonsca
0
172
Member Avatar for PDB1982

[QUOTE=PDB1982;1137706]My problem lies in the fact that the teacher might try to say that I own more than three stands, so then what happens!?!. I'm thinking that there might be a loop or array that would be a little better.[/QUOTE] Since the teacher mentions [I]at least three[/I], this would be …

Member Avatar for WaltP
0
174
Member Avatar for funtoknow

[QUOTE=Aia;531348]Avoid using Miracle C. The Miracle would be if it works correctly at all. There are plenty good free compilers to choose. Look in the starting C post at the beginning of the forum.[/QUOTE] I went to their website for the first time today. It [I]claims[/I] MC is still under …

Member Avatar for pebbles
0
393
Member Avatar for XinJiki

Post the freakin' errors. We can't help you if you keep the errors a secret.

Member Avatar for Shinedevil
0
254
Member Avatar for rahul8590

When you loop through the line you convert only the digits. But if one of the locations is not a digit, not only do you skip it in the source string, but you also skip the same position in the destination array -- leaving uninitialized data in that position.

Member Avatar for WaltP
0
201
Member Avatar for LEEEEE

Why are you resurrecting a 6 year old thread as if you have something to add?

Member Avatar for WaltP
0
214

The End.