6,741 Posted Topics

Member Avatar for navychat

Let's start with the basics. A string in C is a sequence of zero or more characters followed by the '\0' character. By saying [inlinecode]char input1[/inlinecode], you're effectively restricting yourself to only one character, and because strings must be terminated with a null character, you're only allowing yourself empty strings. …

Member Avatar for Narue
0
100
Member Avatar for m_meena

>Please let me know what are the options to specify these includes in command line for various >projects (vc++,C#,vb,net) Is MSDN down, or something? I'd like to believe that you're smart enough to check the reference for your compiler before asking a question that will be answered with "RTFM!". :icon_rolleyes:

Member Avatar for Narue
0
126
Member Avatar for nate12457

Walk through the execution of your program on paper. You'll be able to see the contents of the variables at each step and you can build a table of your expectations. Then run the program in a debugger and verify that the actual execution matches your expectations. Most likely you'll …

Member Avatar for nate12457
0
80
Member Avatar for Brent.tc

>I am making a string class If you want it to be as flexible as possible, you'd do something like the standard string class and use an [url=http://www.dinkumware.com/manuals/?manual=compleat&page=memory.html]allocator[/url]. The default for allocators are new and delete. However, you're free to use whatever you want since this is a class that's …

Member Avatar for Narue
0
162
Member Avatar for shaqnolysis

>and its due tommorrow So? That's not going to get you help any faster. In fact, some of the more perverse members will delight in watching you rush to finish the homework that you put off until the last minute. >The question asked me to determine and explain how the …

Member Avatar for Salem
0
55
Member Avatar for rjc

>still use float, it will work on almost any compiler! Almost any compiler, huh? And here I thought that because it's a standard type, [i]every[/i] C++ compiler is required to support it. :icon_rolleyes: >That does work It does? Presumably you want 60.5 to give you 1 hour and 30 minutes, …

Member Avatar for WaltP
0
96
Member Avatar for Solidsteel86

>main () The main function is defined as: [code] int main ( void ) { return 0; } [/code] Place your code before the return statement. Anything else is wrong. As it is, you're relying on an obsolescent feature (implicit int) and neglecting to return a value, which is undefined …

Member Avatar for Solidsteel86
1
143
Member Avatar for MattEvans

>I mean, if it wasn't explicitly in the standard that 'the pointer will be unchanged on failure', >implementors of the cstdlib library could be free to implement the internal workings of the >function it in their own way True, but the behavior in this case is carefully specified by the …

Member Avatar for Narue
0
138
Member Avatar for conan19870619

>And why a class might provide a "set" function and a "get" function for a data member? If you wisely give your data members only private access, then the only way to access them from outside of the function they're declared in is to use public or protected member functions. …

Member Avatar for n.aggel
0
575
Member Avatar for RatanKumar

>how do you tackle such tough situations? I take a break. Most of the time any severe difficulty I'm having stems from pushing myself too hard. If you take it slowly and work through problems in a methodical way, you shouldn't find yourself overwhelmed. If you try to force too …

Member Avatar for Ramy Mahrous
0
38
Member Avatar for Sturm
Member Avatar for xraaz

I'm seeing a disturbing trend. You get one question answered and then you treat us like your personal homework service. It's not going to work, so try doing it yourself first.

Member Avatar for darkagn
0
89
Member Avatar for spankyg

>I just think it is funny that Dev(Bloodshed) finds it O.K., but VC2005 wont allow it? Your code is wrong, and one of the compilers you use happens to allow the wrong code while the other correctly bitches at you. That's typical behavior when you step out of the realm …

Member Avatar for spankyg
0
138
Member Avatar for Lost in Code...

>scanf( "d%", &a_guess); Format modifiers start with a % symbol. It should be "%d" instead of "d%". >test; Your test function takes two parameters, so you need to provide the arguments. Also, C doesn't allow the omission of parens even if a function takes no parameters: [code] test ( a_guess, …

Member Avatar for Narue
1
111
Member Avatar for Robin_Dragon

>How do you read values from a file you created Open it and read it? How is that not working for you?

Member Avatar for Robin_Dragon
0
148
Member Avatar for khalid0404
Member Avatar for argonaut
Member Avatar for chris53825

>but I CANNOT get the grade nodes to correspond. How so? You didn't post any code, so we have no idea what you've tried. The grade list is just another linked list. There's nothing different just because it's a member of a node in another list.

Member Avatar for Narue
0
124
Member Avatar for xraaz
Member Avatar for xraaz
0
80
Member Avatar for SurviBee

>Anyone know what this is? The number of parameters don't match between the function declaration and definition for determinant.

Member Avatar for SurviBee
0
229
Member Avatar for gplkrsna

>By defualt compiler will assume that main return an int. Only prior to C99. In C99, omitting the return type is a syntax error. >Its ok because string literals are in the heap and not the stack. The who and the what? It's easy to write an implementation that places …

Member Avatar for Narue
0
150
Member Avatar for jaden403

>does it matter that the root is not the smallest value? If you designed it to be then yes, because that's a bug in your implementation. But as you describe the problem, your book is showing a min heap and the wiki article is showing a max heap. Both are …

Member Avatar for Narue
0
59
Member Avatar for rdanda

>My int Main is basically all messed up because based on the examples in my text book it >appears that I should have my cout statements in main, but they are also in the function on some examples. Your main is basically messed up because it's a declaration and not …

Member Avatar for rdanda
0
356
Member Avatar for BigFormat

>If any mod reads it and is in the mood to change my code adding the & I would be very grateful. It's generally better to leave the code as you originally posted it so that any replies remain relevant. If you have a new version of the code, create …

Member Avatar for BigFormat
0
158
Member Avatar for zandiago

When you want help with your code after making changes, it's customary to post the latest version. Otherwise it's extremely difficult to help you effectively.

Member Avatar for iamthwee
0
2K
Member Avatar for Duki

>a constructor to set the month using the first three letters in the name of >the month as three arguments That's weird. >a constructor to set the month using an integer as an argument, a default constuctor You can merge these guys with a default argument: [code] Month ( int …

Member Avatar for Duki
0
141
Member Avatar for Ballar32
Member Avatar for cspivey

>int ndatamax=100; >string line[ndatamax] C++ requires array sizes to be constant. >while(!myfile.eof()) *sigh* It seems we have to tell [b]everyone[/b] that this is the wrong way to use the eof member function. The eofbit is only set [i]after[/i] an attempt has been made to read from the stream and failed. …

Member Avatar for jusakman
0
149
Member Avatar for Lun

>would you like to look at the code? This just slows down the process. Post your code, tell us what errors you're getting, and someone will get to it. "Will you look at the code?", "Can anyone help?", etc.. will invariably be answered with "Yes! Ask already!", so why not …

Member Avatar for Lun
0
145
Member Avatar for mitzoff

>I get undefined refrecence errors relating to 'main' and the log and sqrt functions. I'm not >sure why I'm getting these. I am using gcc in Linux. I'll make an educated guess and say that you didn't link with the math library: [code] $ gcc main.c -lm $ ./a.out [/code]

Member Avatar for iamthwee
0
159
Member Avatar for jarv

>can someone please help?! Two very qualified people have already given you good advice. Are you ignoring their suggestions and hoping that someone does all of the work for you? If not, explain what you've done to troubleshoot and how it didn't work.

Member Avatar for jarv
0
6K
Member Avatar for jaepi

>You could also use #pragma once but it is compiler dependent and deprecated. All pragmas (well, most with the coming of C99) are compiler dependent. You should avoid them whenever possible. And if #pragma once is compiler dependent, how can you say that it's deprecated? Have all compilers documented it …

Member Avatar for GreenDay2001
0
211
Member Avatar for zite.1
Member Avatar for bhmails

>By default, the standard input in c is in the canonical mode, which means that all input is >line buffered and the line would be received only after the linefeed. That's not how buffering in C works. You're confused about the connection between a command shell and a C program. …

Member Avatar for TkTkorrovi
0
303
Member Avatar for complete

>Now I hear that that is wrong and you have to do it the other way. This is a style issue. If your employer requires it, then their word is law. Otherwise, tell the person who said it was wrong it stuff it and do what you find most comfortable. …

Member Avatar for Narue
0
96
Member Avatar for Robin_Dragon

>tell me what i need to do to better it Be careful what you wish for. Your actual problem is that you aren't making a histogram out of a frequency table. A frequency table is the count of occurrences, which is not what you're doing here: [code] array[ val / …

Member Avatar for Robin_Dragon
0
160
Member Avatar for tonyaim83

>That must be a compiler thingy because VC++ 2005 Express doesn't mind it wihout the space. I believe Bjarne Stroustrup called this sort of thing a glorious hack. C++0x will require that the space isn't necessary anymore, but compilers have already started to adopt the new feature as an extension. …

Member Avatar for Narue
0
191
Member Avatar for tonyaim83

Your vector doesn't have any elements to assign to. You need to set the initial capacity, or insert new elements with push_back: [code] #include <iostream> #include <string> #include <vector> using namespace std; int main() { vector<vector<string> > edge_set_test ( 1, vector<string> ( 2 ) ); edge_set_test[0][0] = "1"; edge_set_test[0][1] = …

Member Avatar for Narue
0
133
Member Avatar for anzdyy

>URGENT PLEASE CORRECT FOR ME! THANKS A LOT!!!! You'll get better results if you describe the problems that you're having.

Member Avatar for Salem
0
110
Member Avatar for tonyaim83

>Provided I cannot make define the object globally or at the start of main(). You have to define a variable before it's used, and you have to define a variable within a visible scope. What you're doing is illegal because g1 is defined in a nested scope but used beyond …

Member Avatar for Narue
0
176
Member Avatar for mauro21pl

>What I really looking for is a tutorial regarding the linked list, stack and >queues with a good explanaitions. I haven't yet gotten around to covering stacks and queues, but [url=http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_linklist.aspx]this[/url] may be useful to you. >Have you tried Cprogramming.com Yes, I have. The FAQ is good, the forums are …

Member Avatar for jbennet
0
88
Member Avatar for daniweb2013
Member Avatar for curt22
Member Avatar for annagraphicart

>Well.. I wouldn't know how to do the rest then.... Well, let's start over. What [b]do[/b] you know? We're not mindreaders, so there's no way to tell how much hand holding you need or expect. >how do I get the program to sort the scores Oddly enough, C++ has a …

Member Avatar for Ancient Dragon
0
92
Member Avatar for radskate360

It looks like your logic is reversed a bit. You want to sum both the odds and evens, but in your current logic, it's either one or the other depending on the initial number. Since the range of odd numbers is wider than even numbers, you can include the test …

Member Avatar for zandiago
0
270
Member Avatar for >shadow<
Member Avatar for kahaj

>I can't figure out how to make it word wrap. What's "it"? This question is incredibly vague, and you're unlikely to get a decent answer from it. >the window comes up for a split second, then just disappears Please ignore the majority of what everyone else has told you in …

Member Avatar for Ancient Dragon
0
599
Member Avatar for eXceed69
Re: 51

>How much do most people donate on avg? I donate my time and expertise, so at my usual consultancy rate and a guestimate of about 15 minutes per post, I've donated about $53,000. Add to that the PITA fee of 15% the regular rate and it goes to an even …

Member Avatar for Rashakil Fol
0
516
Member Avatar for sk8ndestroy14

>I don't see that path in the parings. I beat rash and go to the final, and rash beats everyone in the loser's bracket. Or the opposite: rash beats me and goes to the final, and I beat everyone in the loser's bracket. Either way we meet in the last …

Member Avatar for sk8ndestroy14
0
254
Member Avatar for chota

>thanx in advance. For what? You didn't ask a question. You totally overused periods, but I don't see a question mark anywhere in your post.

Member Avatar for TkTkorrovi
0
100

The End.