6,741 Posted Topics

Member Avatar for toko

>i was wondering whenever you create a file in c++ where does it go If you don't supply a full path when opening a file, a relative path is used. That depends on how your system deals with relative paths, but I'd wager that you're on a system that uses …

Member Avatar for toko
0
95
Member Avatar for bc030400412
Member Avatar for mstrmnd2008

>a. change the locale of std::cin from the default locale to one using an ASCII char set. >b. read the char entered by the user >c. convert it to an int to get the ascii code point. >d. use the tolower member of the ctype facet of the locale imbued …

Member Avatar for Narue
0
143
Member Avatar for lvphoenix

>Any help would be greatly appreciated I have been banging >my head on the desk for the last 7 hours working on it. Remove the unnecessary code and work directly with the linked list. You're definitely not handling the links correctly, so I'm going to assume that you need a …

Member Avatar for Narue
1
178
Member Avatar for liphoso

>I dnt want to purchase a book as yet. Then you're already walking on thin ice. >Can any one refere me to a site from which I will be able to learn the basics relatively quick. Yes. There's only one site that offers basic C++ tutorials that I'll recommend (until …

Member Avatar for eranga262154
0
82
Member Avatar for krizz

>I don't know much in depth about recursion, so have no idea how or what to pass there. It doesn't really matter that the function is recursive. Just pass the parameter along without changing it and everything will be fine: [code] #include<iostream> using namespace std; int Sum(int s, int n) …

Member Avatar for anirudhbsg
0
992
Member Avatar for aismm

cin's >> operator and getline don't play well together. Formatted input treats whitespace differently than nonformatted input. More precisely, cin's >> operator leaves a newline character in the stream for getline to terminate immediately on, so it appears as if the call is being skipped. You can fix it by …

Member Avatar for Salem
0
6K
Member Avatar for zandiago

You're overcomplicating things, I think. Here's a sample without the "again" crap that should give you an idea of what's expected when functions get involved: [code] #include <iostream> int findbig ( int num1, int num2 ) { return num1 > num2 ? num1 : num2; } void getnumbers ( int& …

Member Avatar for zandiago
0
7K
Member Avatar for vincent551987vn

>So is that actually your program or did you copy it of someone. I'd wager that since he went from nothing (knowing nothing) to that in two hours, he copied it from somewhere.

Member Avatar for vincent551987vn
0
280
Member Avatar for Ashu@sym

>Basically, I don't understand how a header file being included makes a connection >with the source file that has the definitions for whatever is in the header file. It doesn't. There's no connection at all. The header is there to declare names so that you can compile your source. If …

Member Avatar for Ashu@sym
0
124
Member Avatar for curt22

>Where else can I get it? You might be able to find it somewhere with google, but I'm willing to bet that the dependencies will kick your ass. It's a much better idea to just bite the bullet and download the SDK.

Member Avatar for curt22
0
287
Member Avatar for skyah
Member Avatar for zandiago

Look [url=http://www.dinkumware.com/manuals/?manual=compleat&page=string2.html#basic_string::replace]here[/url] and try to find an overload of replace that takes two arguments.

Member Avatar for zandiago
0
411
Member Avatar for vincent551987vn

>I need the helps, The helps? That sounds like some kind of communicable disease. >please send me the code as soon as you can Why don't you just give us your teacher's email address so that we can send the code directly.

Member Avatar for Narue
0
246
Member Avatar for jerdawg89

>anymore help also i have no idea what prototype is because we haven't learned it yet This is a function definition: [code] int change(float money, int onedollar, int twentyfivecent, int tencent, int fivecent, int penny) { float temp; // ... return 0; } [/code] Note that it has no semicolon …

Member Avatar for Narue
0
117
Member Avatar for amorphis_gr

>can anybody help me ? If by "help" you mean "write it for me", no. Nobody will help you. If you mean help in the more traditional sense of you do the majority of the work and we give you hints and tips, and suggest ways to improve your solution, …

Member Avatar for Ancient Dragon
0
127
Member Avatar for ksri

Ugh, what an awful example. >void main() int main ( void ). No excuses, and the only portable return values are 0, EXIT_SUCCESS, and EXIT_FAILURE (defined in stdlib.h). Returning nothing isn't an option. >student var1,*a; While your C++ compiler might accept this, the C language requires that you include the …

Member Avatar for Ancient Dragon
0
161
Member Avatar for Ashu@sym

>If \0 is the same as 0 then why isn't \t the same as t or \n the same as n? AD wasn't being quite clear when he said "literally". '\0' isn't a special escape sequence like '\t' or '\n', it's a manual escape sequence where you define the integral …

Member Avatar for Ashu@sym
-1
7K
Member Avatar for Robin_Dragon

[quote] Relax Ancient Dragon. No sense in waving accusations like that around. Be cool. OK. Jeez. Nevermind, Mr. Dragon, i'll figure it out myself. I'll just remove the post since it offense everyone. [/quote] Translation: "Oops, I got busted trying to cheat." ;)

Member Avatar for Narue
0
2K
Member Avatar for nquaoser

What have you tried? The answer you're looking for is a classic example of a controversial solution, but it's not overly difficult if you know how loops and pointers work.

Member Avatar for n.aggel
0
338
Member Avatar for kohkohkoh

>This program gets very easy with the use if recursive >function if the job is only to print the number in the reverse order. So, was it worth resurrecting a three year old thread to post some bad code?

Member Avatar for Narue
0
181
Member Avatar for kamlesh_ag07

>there was a error telling "namespace name required" Post your code.

Member Avatar for ChaseVoid
0
97
Member Avatar for Lost in Code...

You're...um...not using a loop at all. You can't expect code to repeat if it doesn't loop somehow.

Member Avatar for ChaseVoid
0
121
Member Avatar for baberca

>this is about my sjf project and srtf........................... What the hell are sjf and srtf? Speak plainly and properly. >so pls help me ryt now I'm afraid help is impossible as you haven't described any problem with the posted code. If you'd like a code review, I'll be happy to …

Member Avatar for Salem
0
306
Member Avatar for n.aggel

>so the question is how can the compiler think that this is function This is how it would be parsed: [code] deque<int> c ( istream_iterator<int> cin, istream_iterator<int> ); [/code] That looks exactly lot like a function declaration, doesn't it?

Member Avatar for n.aggel
0
114
Member Avatar for conan19870619

>is there any limit/constraint on the maximum number of nodes that a linked list can have? It depends on how you implement the list. >a linked list does not have to be implmented with a pointer. what else can be implementeation of linked lists? Anything that can specify the location …

Member Avatar for conan19870619
0
136
Member Avatar for Narue

I've noticed several times a couple of odd occurrences on the forums recently. 1) Sometimes I simply cannot mark a forum as read. I'll read all of the forums, explicitly mark the forum as read, and mark all forums as read, yet the forum will still show as having unread …

Member Avatar for Michele_Verona
0
250
Member Avatar for pprabhakar

Google came up with [url=http://www.newty.de/fpt/index.html]this[/url] as the first hit. Did you even attempt to search for information before asking here?

Member Avatar for Narue
0
107
Member Avatar for louise07

Still too vague. Printing is system dependent, and sometimes hardware dependent. You can try opening a file to "LPT1", or "PRN", and pray that it works. Otherwise, tell us your OS and compiler so that we can give you more specific help.

Member Avatar for louise07
0
90
Member Avatar for koolboy
Member Avatar for Llama

>-it just skips through cin.getline(File, 255) without waiting for the user's input Probably because you have a [INLINECODE]cin>> x;[/INLINECODE] somewhere earlier in your code and a newline is left in the stream for getline to terminate successfully on right away. Nothing is getting skipped, it's working as written. You just …

Member Avatar for Llama
0
118
Member Avatar for laoballer

>I think my biggest problem is not being able to see how to create this nested loop. Okay, you know you need to loop to fill up the array, right? [code] array [0..MAX] of integer num as integer while size < MAX do get num from stdin if eof ( …

Member Avatar for Narue
0
120
Member Avatar for someguy88

>It works good now, but i would like to know how it works. These two links should give you more information than you probably want right now. ;) [url]http://www.eternallyconfuzzled.com/tuts/algorithms/jsw_tut_rand.aspx[/url] [url]http://www.eternallyconfuzzled.com/arts/jsw_art_rand.aspx[/url]

Member Avatar for Narue
1
98
Member Avatar for Electrohead

>Finally I have made my site valid XHTML 1.0 transitional and CSS! Now go for strict. That's what [url=http://validator.w3.org/check?uri=http%3A%2F%2Fwww.eternallyconfuzzled.com%2F]my page uses[/url]. >do you bother to make your sites valid markup? Yes, if only so that I can thumb my nose at lesser developers. :D

Member Avatar for MidiMagic
0
297
Member Avatar for Necrolis
Member Avatar for gopy

>I'm trying to develop my final year computer science project, >but don,t know were to start from....cannot think of any ideas. It's scary how often I see this situation. How could you [b]possibly[/b] have gone through x number of years toward a CS degree and have [i]no clue whatsoever[/i] what …

Member Avatar for Salem
0
238
Member Avatar for DemonSpeeding

>transform(names[count]begin(), names[count].end(),names[count].begin(), toupper); Good idea, unsound implementation. The problem is that toupper is overloaded and your compiler may create an ambiguity behind the scenes. On top of that, even if your compiler does the right thing and picks the C toupper, the behavior is [b]still[/b] undefined because transform expects a …

Member Avatar for vmanes
0
114
Member Avatar for dblbac

>ifstream infile; You define infile, but then proceed to use indata. Perhaps you meant to define indata rather than infile?

Member Avatar for dblbac
0
184
Member Avatar for gator6688
Member Avatar for Narue
0
158
Member Avatar for tnvkrishna

>but using cout or any object of ofstream also makes the data to be outputted You're mixing things up. Any object derived from ostream contains a buffer. It's this buffer that "makes the data to be outputted", and when it sends characters from the buffer to the destination (the destination …

Member Avatar for vijayan121
0
115
Member Avatar for kamlesh_ag07
Member Avatar for iamthwee
0
79
Member Avatar for rukshanrc
Member Avatar for Narue
0
17
Member Avatar for step2stepgirl

>first i need to know if my implementation to the function is right Does it compile? Does it run? Does it produce the results you expect? Do you get the expected results for a large number of test cases? Those are the first questions you ask yourself to see if …

Member Avatar for step2stepgirl
0
217
Member Avatar for sean25hun

[code] void printDate( enum Months, int day, int year ) { switch ( enum Months month = JAN ) [/code] I'm guessing what you really wanted here was: [code] void printDate( enum Months month, int day, int year ) { switch ( month ) [/code] Your random month isn't exactly …

Member Avatar for sean25hun
0
72
Member Avatar for kako13

>you must read something before the loop test, then read >that element as the last action in your loop body, similar to: What a waste of effort. How about, instead of having to figure out the order of operations and throw in redundant code to make it work, you just …

Member Avatar for Narue
0
1K
Member Avatar for tehloki

>all my code does is generate a seg fault whenever I try and add a new element. That makes perfect sense. Here's how you call elementCreate: [code] Element *new; /* new element */ if (!(new = elementCreate(new, data))) return(NULL); [/code] And here's the definition of elementCreate: [code] Element *elementCreate(Element *new, …

Member Avatar for Narue
0
126
Member Avatar for step2stepgirl

>I've tried so hard to do it but I couldn't I don't believe you. Post your attempts and describe how they didn't work to prove that you've tried "so hard". >I have to send it to my professor tonight so please HELP We generally don't care how much of a …

Member Avatar for step2stepgirl
0
121
Member Avatar for ankit_nasa

It would be more productive if you told us what errors you were getting rather than begging for free solutions to your homework.

Member Avatar for Narue
0
72
Member Avatar for Genar Codina

>So, how can I "destroy", not the raw storage, but the "arrayUnsignedChar"? Why are you trying to call the destructor for a built-in type anyway?

Member Avatar for Genar Codina
0
161
Member Avatar for syama.sasi

The End.