6,741 Posted Topics

Member Avatar for Barefootsanders

>For some reason, it crashed right here. The only reason for a crash there is if listOfLists can't be dereferenced (if it's NULL, for example).

Member Avatar for Barefootsanders
0
93
Member Avatar for AKCotton

It has to be compatible with the slot, but how does this have anything to do with software development?

Member Avatar for AKCotton
0
26
Member Avatar for johny112

>Cant figure out why. Um, because you're using those two variables before giving them a value. >int hours, rate_of_pay, salary_with_overtime, salary_without_overtime; >salary_without_overtime = rate_of_pay * hours; >salary_with_overtime = (40 * rate_of_pay) + ((hours - 40)* 1.5 * rate_of_pay); Look at the first line, then look at the next two lines …

Member Avatar for Ancient Dragon
0
87
Member Avatar for mank

>I would like to have a general format that would >produce such arrays for any given parse tree. It looks fairly simple. Just recursively traverse the tree and save the paths as you go: [code=c] #include <stdio.h> #include <stdlib.h> struct node { int data; struct node *link[2]; }; struct node …

Member Avatar for Narue
0
108
Member Avatar for matt611

>could someone please tell me what I need to use for this? Something besides char* because you obviously don't know what you're doing. I'd suggest using the string class, then you can use the c_str member function to get a pointer to const char for your hash function.

Member Avatar for ravenous
0
123
Member Avatar for The Dude
Member Avatar for hbk619
1
89
Member Avatar for c.kiranmayee
Re: Cprg

>i am sry..i was in ahurry.. I think you're still in a hurry. Slow down, compose a coherent post with correct spelling and grammar, then you can use "in a hurry" in the past tense.

Member Avatar for ithelp
0
85
Member Avatar for adikesan

Try [url=http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_linklist.aspx]this tutorial[/url]. Though I get the sinking feeling that it's not suited for you. :icon_rolleyes:

Member Avatar for rajusankar28
0
124
Member Avatar for trupti
Member Avatar for ricnyx
Member Avatar for Sturm

>I see every new member as a potential regular member, if given the chance. I wonder what would happen if we took a month's worth of statistics on new members, then after another month see how many of those members are still active. Do the same after six months and …

Member Avatar for MidiMagic
0
496
Member Avatar for Dha_King

>I have searched the webb but can't find a solution for it. Then how do you know it's an easy problem? My guess is that you didn't look very hard, because the answer can be found easily. >ch is a const char ch, as u can see. Yes, I can …

Member Avatar for Dha_King
0
1K
Member Avatar for vegaseat

C++: [code] #include <iostream> int main() { std::cout<<"Hello, world!"<<std::endl; } [/code] Euphoria: [code] puts(1, "Hello, world!\n") [/code] Forth: [code] : HELLO ." Hello, world!" CR ; HELLO [/code] Java: [code] class hello { public static void main(String [] args) { System.out.println("Hello, world!"); } } [/code] C#: [code] using System; class …

Member Avatar for sgssergio
0
1K
Member Avatar for Ken JS
Member Avatar for alcoheca

Your code shouldn't compile at all because you haven't terminated the structure definition with a semicolon. >date.d = atoi(str_date.substr(0,2).c_str()); >date.m = atoi(str_date.substr(2,3).c_str()); >date.y = atoi(str_date.substr(4,7).c_str()); substr doesn't use a begin/end pattern, it uses a begin/count pattern. The second argument should be 2, 2, and 4 for those three lines, respectively. …

Member Avatar for Narue
0
264
Member Avatar for scru

>I want to know if that's a good idea, or what to look out for. If your goal is C++, there's little point in side tracking yourself with C. But do keep in mind that C and C++ require different mindsets. Good C isn't necessarily good C++, and vice versa. …

Member Avatar for Narue
0
82
Member Avatar for needHelp27
Member Avatar for Jishnu

>I'm using TC++ 3.0. Why? >I think that the compiler is faulty. And? Salem agreed with you [b]if[/b] the code you posted is exactly the code you're running. What more are you looking for?

Member Avatar for WaltP
0
98
Member Avatar for Loyen

>So, by now it seems like C++ will be the futures programming language. Why? If it really seems that way then you should be able to point out a list of convincing reasons. >But what do you think of the future of programming languages?? I don't really care. As programming …

Member Avatar for Narue
0
214
Member Avatar for cl3m0ns

>It should be protected rather than public. The Employee members. No, it should be private. Just pretend that it's illegal to have protected data members. >If someone could explain to me how to go about fixing this problem it would be awesome! Add a protected member function that gives child …

Member Avatar for twomers
0
332
Member Avatar for phoenixlsk

>I tried something but it didn't work. I tried something and it did work. I guess the problem is with your code somewhere between the beginning and the end.

Member Avatar for Narue
0
113
Member Avatar for Ratte

>what/where could I use a hash table (chaining?) in my program. That's ass backward. It's a solution looking for a problem, not a problem looking for a solution.

Member Avatar for Narue
0
121
Member Avatar for peter_budo

If you get banned from this forum, you're not likely to last long on PFO. We're far less forgiving over there.

Member Avatar for jwenting
0
167
Member Avatar for jbennet

>My compiler says my code isnt standard c++? Your compiler is right. >#include <iostream.h> Some people will try to tell you iostream.h is deprecated, but they're wrong. It was never standard to begin with. Since you clearly think you're using the standard iostream anyway, you might as well just hack …

Member Avatar for jbennet
0
152
Member Avatar for marzuki

>char date1 = "03"; >char date2 = "06"; >char date3 = "2007"; >char new string; None of these are strings in C. Your syntax is way off. >what I need is new string like: >new string =03-06-2007.txt Look up sprintf. You can also use strcat if you want a more …

Member Avatar for Narue
0
81
Member Avatar for joshmo

Check your spelling, check the number of arguments, check the type of arguments, and if none of that works, make a tiny program that exhibits the problem so that we can actually compile and link it ourselves instead of trying to decipher the snippets that you [i]think[/i] are relevant.

Member Avatar for joshmo
0
82
Member Avatar for RohitSahni

Or you can use stringstream and getline with ':' as the delimiter. That's generally easier to get right: [code=cplusplus] #include <iostream> #include <sstream> #include <string> int main() { std::stringstream in ( "A:B:C" ); std::string token; while ( std::getline ( in, token, ':' ) ) std::cout<<"Split token: "<< token <<'\n'; } …

Member Avatar for RohitSahni
0
555
Member Avatar for DennisB

You're storing the factorials in an array, but that doesn't change how you calculate the value. Do you know how to calculate a factorial?

Member Avatar for Narue
0
8K
Member Avatar for badbloodyeyez
Member Avatar for Koldsoul

>Both methods throw an exception if you try to enter something other than an integer. How do you figure that? Only the second will actually throw an exception. The first will simply set cin to an error state (in which case the ignore will effectively be a no-op).

Member Avatar for Salem
0
104
Member Avatar for clm

Let me get this straight. You went through four years of college with a focus on computer science and have [i]no idea[/i] how to build your projects on your own? I hope you didn't pay much for that course, and I'm rather afraid that you're about to enter the workforce …

Member Avatar for Ezzaral
0
97
Member Avatar for Ratte

>Do you have to have the studio or C++ express will do? The Visual C++ Express debugger is fully functional.

Member Avatar for Narue
0
113
Member Avatar for Ccrobinson001

>This is a math problem. No, it's not. Reading the data as an integer strikes me as dangerous in this case. I can easily see integer overflow being a potential problem, and that serious affects the robustness of the code. Something like this would be better: [code=cplusplus] #include <fstream> #include …

Member Avatar for Ccrobinson001
0
97
Member Avatar for leeqiang

>i wanna know how to output a B-tree like that: Please don't refer to binary trees as B-trees. A B-tree is a separate data structure with significant differences. As for how to print a [b]binary tree[/b] like you want, you can do it a number of ways. However, that particular …

Member Avatar for Narue
0
171
Member Avatar for sean25hun

It looks like the input specifies indices of which values are to be set to 1. Let's say you have an array of 10 rather than 100 (because I don't want to type that much). You initialize the array to 0's: [code] {0,0,0,0,0,0,0,0,0,0} [/code] Now let's say the user types …

Member Avatar for Lerner
0
81
Member Avatar for HLA91

>I started learning C# but I became annoyed at the need for the >.NET enviroment on every machine the program was run on C# has no such restriction. It's a standardized language that can run outside of the .NET framework[1]. However, you're going to find this annoyance everywhere you go …

Member Avatar for HLA91
0
152
Member Avatar for sunrise2007

>the line 6 ::is it like declare a varible or pointer or what ?? It's an object definition. stringstream is a class, just like string. >becouse ,when i print ss without str() i see address ,what is that mean?? It means that stringstream doesn't have an overloaded operator<< for stringstream, …

Member Avatar for sunrise2007
0
158
Member Avatar for FrankHere

>since i do not have any Industrial Experience.. It's a final year project. Just pick something you learned that exhibits your newfound skills and seems interesting. It doesn't have to be practical or viable in the market, so asking for advice from people with "Industrial Experience" is silly.

Member Avatar for Salem
0
173
Member Avatar for cl3m0ns

>I was hoping some one could shed some light on the reason this works. Think of it as a normal range shifted to fit your lower bound. When you use x % y, it forces x to be within the range of 0 to y. This corresponds to [ICODE]rand() % …

Member Avatar for joshua.tilson
0
151
Member Avatar for guitarrick

>int card_value, card_face, card_value; >int card_value[4][4]; So, how many variables are you going to try to give the exact same name? >int fill_values(card_value[4][4]); You sure do like the name card_value, but for a function declaration you need to provide a data type for the parameters. In other words: [code=cplusplus] int …

Member Avatar for guitarrick
0
197
Member Avatar for nosa2008

So...have you tried [b]anything[/b] yet? If so, posting a little code would make you look like far less of a "gimme gimme" noob, and someone might actually help you.

Member Avatar for Ancient Dragon
0
101
Member Avatar for nathanrt

If a number is divisible by 2, it's even. If it's not divisible by 2, it's odd. You can find out if a number is divisible by 2 by finding the remainder of division by 2. C++ has a remainder operator, %. So it stands to reason that if you …

Member Avatar for Narue
0
3K
Member Avatar for umerkk

There's plenty of software to control computers remotely, but if you want to do it by phone line, the computer has to be connected to one (which is quickly becoming a scarce occurrence). Most likely you're searching for the wrong thing (because your search strings are incorrect), or you're searching …

Member Avatar for Narue
0
42
Member Avatar for imran_s

>For example if i convert 255 from base 10 to base 2 >i am getting 11111110 instead of 11111111. That particular example works fine for me. Though your code has some...interesting aspects.

Member Avatar for Aia
0
4K
Member Avatar for garap

>But the easiest to code is standard qsort() method. Which, despite the name, isn't required to be quicksort. ;)

Member Avatar for Narue
0
62
Member Avatar for FoX_

>I'm using the stack twice and I didn't find it efficient. Are you just eyeballing it and thinking "that can't be efficient", or did you profile multiple executions and get hard numbers that proved it's consistently slower than your allowable limit?

Member Avatar for FoX_
0
2K
Member Avatar for dblbac

>after the 10 guesses or if the the guesser gets it correct it >should ask if the player wants to play again and react accordingly. So wrap the whole thing in another loop and prompt for whether the user wants to play again.

Member Avatar for dblbac
0
156
Member Avatar for HLA91

>it wont compile and I dont understand the error message And we're supposed to divine what that error message is? Maybe you should post it.

Member Avatar for HLA91
0
141
Member Avatar for picass0

>out<<num.a; >out<<num.b; First I'd suggest you separate those two values with something. Your actual output is 43,0. [code=cplusplus] if(i==1) { num.a = line[i]; } [/code] At position 1 in "7+i3" is '+'. So the first problem is that you're assigning the wrong character. The second problem is that you're assigning …

Member Avatar for Narue
0
90
Member Avatar for c++ prog

>can anyone please tell me how? Use stringstream to handle the conversion for you. This relies on the existing formatted input code and saves you the trouble of writing the tricky algorithms yourself: [code=cplusplus] #include <iostream> #include <sstream> #include <string> int main() { std::string line; std::cout<<"Enter a number: "; if …

Member Avatar for Narue
0
89

The End.