6,741 Posted Topics

Member Avatar for jaepi

>which can be used by including. #include <fstream.h> Please don't encourage the use of pre-standard headers. We're getting to the point where compilers will refuse to build code that uses them.

Member Avatar for jaepi
0
247
Member Avatar for satyanarayanam

>putc() would output 1 character only, and not really useful or effective in this case. You must have missed the part where he said "in a loop" and "to display each character one at a time". Of course, the question is a bit ambiguous.

Member Avatar for Narue
0
156
Member Avatar for krishu

Asking for answers to be sent to you is against the rules. We also have a policy of not giving answers to those who have shown no effort. So please give the problem a try before begging for freebies.

Member Avatar for Narue
0
93
Member Avatar for IwalkAlone

>*ptr = toupper(*ptr); You forgot to include ctype.h. >/* first letter of string */ This is a benign logic error. The end result is that it doesn't cause a problem if the first character in the string isn't a letter, but the fact that you always do it suggests a …

Member Avatar for IwalkAlone
0
1K
Member Avatar for rati

>its a very simple logic You'd think, but that might not be the case. >but the problem is its showing segmentation fault. I'd wager my next pay check that you're trying to strtok a string literal.

Member Avatar for rati
0
105
Member Avatar for laconstantine

Either you're incredibly dense, or you're putting way too much thought into something simple. Given [INLINECODE]char *str = "Hello"; [/INLINECODE], "Hello" is const, str is not. The assignment is allowed, but you can't use str to modify "Hello". That's as deep as it goes, so stop digging.

Member Avatar for Narue
0
298
Member Avatar for SelArom

>see .net makes it easy to connect to different data sources like >databases, access files, and xml files. This is true. >but whenever I look in C++ books they always talk about using the STL >like lists, stacks, and other structures. That's because those books teach standard C++ and can't …

Member Avatar for ~s.o.s~
0
177
Member Avatar for ebmusicman

It sounds like you want the equivalent of getch and kbhit. Search for those two on these forums and you'll find sample code for those functions and alternatives. Keep in mind that what you want to do isn't portable.

Member Avatar for ebmusicman
0
134
Member Avatar for ithelp

>need a simplified version That's easy, there's no such thing. Be specific about the context in which the algorithm would be used and an efficient one can be suggested.

Member Avatar for Rashakil Fol
0
127
Member Avatar for Radons

My Pascal is a tad rusty, but I'm reasonably sure the C++ translation is thus: [code] void gPacker::InvertInteger ( unsigned int i ) { Result = ( i & 0xff ) << 24; i >>= 8; Result += ( i & 0xff ) << 16; i >>= 8; Result += …

Member Avatar for Radons
0
227
Member Avatar for jrivera

Your types are all screwed up. You use charT, traitsT, and diff without defining them, for instance.

Member Avatar for Narue
0
118
Member Avatar for ft3ssgeek

C-style strings aren't compared with ==, you have to use strcmp or equivalent. What you're doing now is comparing two addresses that are unlikely to be the same, not the contents of two strings.

Member Avatar for iamthwee
0
142
Member Avatar for jaeSun

n is a highly suspect name for a global variable. Did you accidentally declare a local variable n that was not an array? The global n would be hidden by the local n and you would get that error.

Member Avatar for ~s.o.s~
1
1K
Member Avatar for anw

>Why would it use two different copies of strcmp? Presumably the two copies are the standard strcmp and your own strcmp with the same name. Overriding a standard function with a custom function of the same name is tricky business. >How do I force it to use my version? Give …

Member Avatar for Salem
0
111
Member Avatar for ~s.o.s~

Does rep still fade away into nothing on the control panel? I'd love to be able to page through all of my rep instead of the most recent 15. At the very least it would be nice to be able to search for a member's (mine or someone else's) posts …

Member Avatar for John A
0
149
Member Avatar for bob1989

>as i missed the lectures and practical classes involving that.. You "missed" them? And the instructor as well as your classmates refuse to offer any help at all? That seems somewhat suspicious. Anyway, it's difficult to help you without seeing some kind of attempt because we can't judge your level …

Member Avatar for Narue
0
116
Member Avatar for jenco

Split into a new thread. Please don't post unrelated questions into existing threads.

Member Avatar for anw
0
67
Member Avatar for guy40az

There's a header called time.h (ctime in C++) that contains the functions and types you need. Try a google search for details, and if you have trouble with the actual implementation, feel free to ask here for help.

Member Avatar for guy40az
0
97
Member Avatar for jan1024188

MFC is a (large) collection of classes for writing Windows applications in C++. It's a wrapper around the Win32 API.

Member Avatar for jan1024188
0
127
Member Avatar for iTaChi

>infact, i have made my website about c programming.. I'd recommend learning C before trying to teach it. Your code is poorly written and your explanations of the code are severely lacking. >Don't. Get the Express version of VS 2005: If you stick to C, Visual Studio 6 is okay. …

Member Avatar for Narue
0
149
Member Avatar for nanosani
Member Avatar for rapperhuj
Member Avatar for yesm

Your class doesn't meet the requirements for a POD type, so using read and write is undefined. Add a couple of member functions that serialize your class to and from a string, then use that string for file I/O.

Member Avatar for Narue
0
142
Member Avatar for squinx22
Member Avatar for Dani

Where's the rant and rave smiley? :@ doesn't cut it for my level of bitchiness. Are you trying to tell me something? ;)

Member Avatar for joshSCH
2
1K
Member Avatar for cyberman111

>so ANYONE dare to try You're making it sound like this program is difficult and it takes courage to complete when in reality it's trivial and takes little more than sufficient boredom to churn out a bit of code. So are you trying to get us to finish your homework …

Member Avatar for cyberman111
0
153
Member Avatar for yesm

Eh, a general rule of thumb is not to loop with iterators if you're going to modify the container. The good news is that the algorithm header has a function template that you can use to remove all occurrences of an item: [code] #include <algorithm> cout << "Input course number …

Member Avatar for vijayan121
0
577
Member Avatar for grunge man

[code] int sum = 0; while ( n <= i ) { int save = n * 26 * n; sum += save; cout<< save <<endl; ++n; } [/code]

Member Avatar for grunge man
0
176
Member Avatar for Coach_Nate

Environment variables aren't expanded in string literals. You need to call something like getenv to get the value: [code] #include <cstdlib> //... const char *appdata = std::getenv ( "APPDATA" ); if ( appdata != 0 ) { std::string path = appdata; path += "\\Folder\\file.txt"; std::ifstream file ( path.c_str() ); //... …

Member Avatar for Narue
0
328
Member Avatar for vikter

>Why use Win32 api? Why not? >It is C (Microsoft C plus Standard C). A C API can be used by C++ too. >For GUI programming in Windows use MFC (Microsoft Foundation Classes) up to Visual C++ 6.0. I agree to a point. MFC helps for the things that MFC …

Member Avatar for Narue
0
181
Member Avatar for pockafella

>I will have to post it in a new thread once I get to a computer that has >that, probably tomorrow or the next day Don't start a new thread. Just reply to this one.

Member Avatar for Narue
0
98
Member Avatar for sushanttambare

>I want to know the optimization code for following c source code So you've profiled your code and found the code you posted to be a bottleneck? If you haven't done that, you have no business optimizing it.

Member Avatar for Infarction
0
116
Member Avatar for Dani

>If you could change one thing, what would it be? The time it takes for every page to load is painfully slow. Unless I disable advertisements, we're talking on the order of ten seconds from the time the page starts loading to the time I can scoll and click and …

Member Avatar for lemurexplosion
0
2K
Member Avatar for generalGOTCHA

Where are you storing it? How you proceed depends on the quotation rules of whatever storage medium you're using. For example, if you were pasting that into a C++ string literal, you would need to escape the quotations for it to work: [code] "Set autoUpdateClient = CreateObject(\"Microsoft.Update.AutoUpdate\",strComputer)" [/code]

Member Avatar for generalGOTCHA
0
102
Member Avatar for shamma

>pls if you dont no how to solve the solution above do replay to me Rash knows the answer, as do many of us, but he's refusing to give it to you because the problem is clearly homework and you haven't shown any effort. >im seriase pls I'm serious too. …

Member Avatar for jbennet
-1
289
Member Avatar for Infarction

>I think it would be fun to ridicule them, as it seems like all the negative >repping is being done by 1-2 people... The logic is that if you know who gave you bad rep, you would give them bad rep in return. Personally, all I care about with rep …

Member Avatar for ~s.o.s~
0
261
Member Avatar for PeeJay

>I am new to this discussion community as you've probably already seen >but I'm not a dummy so don't talk to me like one! Whether you're new or not is irrelevant. You've shown a lack of concern for proper formatting despite being told in detail the merits of it. I'm …

Member Avatar for Nick Evan
0
302
Member Avatar for Duki

>if ( den = 0 ) { >while ( den = 0 ) { = is assignment, == is comparison.

Member Avatar for Narue
0
100
Member Avatar for yuzhang
Member Avatar for Narue
0
122
Member Avatar for eXceed69

>But one thing I've noticed the tutorials are so dull/empty,why? Probably because not many people are good at writing quality tutorials...

Member Avatar for happygeek
0
138
Member Avatar for Senel

>how can i get the medain value of these marks ? ( it may be even or odd) If it's odd, take the middle number. If it's even, find the mean of the two middle numbers. It's a cake walk. :)

Member Avatar for Senel
0
145
Member Avatar for ReeciePoo

You're best bet is to get "Programming Windows, 5th Edition" by Charles Petzold. It's the definitive book on programming Windows applications with C. As for a tutorial, I always rather liked [url=http://www.foosyerdoos.fsnet.co.uk/]this one[/url].

Member Avatar for ReeciePoo
0
112
Member Avatar for rwagnes

You have plenty of options: pipes, sockets, environment variables, files... Just pick one and run with it.

Member Avatar for Narue
0
76
Member Avatar for bigben09

>Where do I put the array? There's only one place: main. But since you're using std::strings you're probably also in a position to use std::vectors as well. They should be preferred over arrays: [code] // Other includes #include <vector> // Person declaration int main() { std::vector<Person> v; bool done = …

Member Avatar for Narue
0
153
Member Avatar for Ali Shahzad

>but can any one tell me How the computer Reads it i mean how is the sontrol transfered plzzz Do a google search for "recursive fibonacci trace". Most of the pages will have at least one image showing you transfer of control within the recursive path.

Member Avatar for Narue
0
121
Member Avatar for wheelie

Please read our rules, FAQs, and stickies before posting. It saves you the embarrassment of making mistake #1 in asking for freebies.

Member Avatar for fulyaoner
0
144
Member Avatar for steve_d

>Regardless of whether you are using C or C++, moving the '\0' character >around isn't the solution. (both languages have library functions for string manipulation) For C that statement is debatable. For a full trim it might be better to do the whole operation in one swell foop, [b]if[/b] strncpy …

Member Avatar for ~s.o.s~
0
100
Member Avatar for jenymaru08

>Got it? Please. With that kind of explanation, even [B]I[/B] wouldn't get it. :icon_rolleyes:

Member Avatar for ndeniche
1
131
Member Avatar for addicted

>i read that in C++ some programmers consider using break and continue >statements as a violation of structured programming practise....... and >usually avoid using them except in switch statements... That's because they're stupid. It's like the whole single entry single exit crap that structured programming aficionados spew. The result is …

Member Avatar for Narue
0
161
Member Avatar for sk8ndestroy14

>But anyway, has anyone actually killed Ruby Weapon in Final Fantasy VII? Yes. Personally, I thought Emerald was harder. >Any tips or hints or strategies for it? You're going to lose two members of your party, so make sure that all of them can cast a powerful life and link …

Member Avatar for EnderX
0
277

The End.