6,741 Posted Topics

Member Avatar for m16jim

>I have a question on an assignment that has me confused. And confused you should be, because the question is ambiguous. >The question is how many times does the following loop execute? The real question is what language is that? If it's pseudocode that follows C++ rules, the loop will …

Member Avatar for Narue
0
124
Member Avatar for vinaychalluru

>hope this helps u gettin final code... >I have a soln for solving armstrong numbers I take solace in the fact that people who give away homework solutions usually come from the shallow end of the programmer pool. :icon_rolleyes:

Member Avatar for Narue
0
78
Member Avatar for helixkod

I believe GCC comes with Mac OSX. There's the Xcode IDE as well, but I'm not sure what compiler it uses. Unless you're using one of those Mac Minis, you should already have a compiler installed and ready to go. >If i compile it on the Mac, will it work …

Member Avatar for vijayan121
0
177
Member Avatar for mandsmom
Member Avatar for WaltP
0
230
Member Avatar for kodiak

What exactly are you looking for a tutorial on? A tutorial on Visual C++ Express Edition is somewhat of a vague request. You'd be better off buying a book that covers Visual Studio if you want a detailed tutorial on how to use the application.

Member Avatar for Ancient Dragon
0
143
Member Avatar for gator6688

The problem is that you calculate the final grade when printing the table, but don't calculate the letter grade until the next loop. At that point the final grade is set to whatever the final grade of the last student was. You need to merge those two loops: [code=cplusplus] cout<<"Student …

Member Avatar for gator6688
0
327
Member Avatar for Jacky1

>Everything without using pointers and strings By "string" you mean the std::string class? Assuming you can store the characters for a word somewhere (like an array or a vector), it's fairly easy to follow those rules. However, without knowing what level of C++ you're at, I'll probably end up giving …

Member Avatar for Narue
0
101
Member Avatar for Serunson

You can have my hat if you want. It doesn't go with the rest of my wardrobe.

Member Avatar for Serunson
0
174
Member Avatar for Alethea
Member Avatar for Narue
0
136
Member Avatar for piscean123

>printf("Enter Number :"); You should call [ICODE]fflush ( stdout )[/ICODE] after this. The stream buffer is only guaranteed to be flushed when it's full (which you can't portably determine), when a newline is printed (which you aren't doing for this prompt), or when fflush is called. If stdout isn't flushed …

Member Avatar for piscean123
0
138
Member Avatar for dockuvn

>I have searched anywhere and ask many people but I couldnt find out the way to do it. Did you bother to ask the teacher that's forcing you to do it? Teachers tend not to ask you to do something that you have absolutely no knowledge of.

Member Avatar for Narue
0
25
Member Avatar for AXAsianXie
Member Avatar for mank

>int n; >float a[n]; Not only is initializing an array size with an uninitialized variable hideously broken, array sizes in C++ have to be compile-time constants, so what you're trying to do won't work anyway. You need to either handle the memory manually with new[] and delete[], or use a …

Member Avatar for Ancient Dragon
0
111
Member Avatar for tnvkrishna

>can a class allow a friend method of a friend class to use it's protected or private members Just because you're my friend doesn't mean your other friends are also my friends. >can a friend method of a derived class use base class's protected members If you're my child, your …

Member Avatar for vijayan121
0
113
Member Avatar for bStiffler582

You don't change a file in-place, you either read the file into memory and make your changes before truncating the file and rewriting it, or you use a temporary file so that only one record is in memory at a time.

Member Avatar for bStiffler582
0
167
Member Avatar for Gadgetman_53

Can you provide an input to this function that produces an incorrect result? [edit] Also include what the correct result should be. [/edit]

Member Avatar for Gadgetman_53
0
876
Member Avatar for danbellinger1
Member Avatar for Narue
0
125
Member Avatar for scru

My hobbies are rock climbing, tennis, creative writing, programming, and martial arts. I particularly enjoy the rush of physical exertion and being able to do things that other people can't. When I'm bouldering a brick wall or running through a kata and people stare at me dumbfounded, it's a good …

Member Avatar for jwenting
1
372
Member Avatar for Pierrot le fou

>I read that Borland 2007 was easier to use than VC++. Do you have an opinion on this ? I don't think it is, but I can see how some people would feel that way. Visual Studio is a feature rich development environment. Borland doesn't throw everything in your face …

Member Avatar for Narue
0
100
Member Avatar for jacknight

>but what is the purpose of the retrieval operation? I would assume it's a search member function that gives you the node at a particular index or with a particular value.

Member Avatar for Narue
0
150
Member Avatar for ITapprentice

>I dislike the idea of diddling with the input stream like that. Any time you go back and forth in a track that [i]should[/i] be one-way, it feels wrong. My problem is that ungetc is restricted enough to be frustrating and flexible enough to be virtually useless. However, there are …

Member Avatar for Narue
0
217
Member Avatar for gator6688

>It will only display the second student I enter but not the first. It will only ever display the last record entered. You're using the temporary variables to print your table instead of the contents of the vector.

Member Avatar for Narue
0
102
Member Avatar for theteamdrunk

>What should I declard it as. int, perhaps? And initialize it to 0? i is a counter that starts at the beginning of the string and looks for the null character. Are you really trying to say that you don't understand how an array index works?

Member Avatar for Aia
0
210
Member Avatar for dblbac

Let's use some multiple choice logic, shall we? 1) The likelihood of (d) is minimal, otherwise there would be similar choices. 2) (c) can be ruled out because (a) and (b) both have the same value for ch. This logic rules the options down to deciding between .2 or .0.

Member Avatar for dblbac
0
161
Member Avatar for dblbac

When you say --x, x is decremented by one before being used in the expression. Likewise, ++x increments x by one before using it in the expression. x++ or x-- will perform the increment or decrement after using the value in the expression. [code=cplusplus] int x = 0; int y; …

Member Avatar for dblbac
0
87
Member Avatar for tones1986

>i have already been told im an idiot by other people on other forums! That wasn't very nice of them. >If you can see anything obviously wrong here, please help! I see something suspicious, though it may or may not be wrong. >meanAndMedianAddr(copyArray, size, &mean, &median); mean and median are …

Member Avatar for Narue
0
137
Member Avatar for piscean123

>I suppose you could do this, just to see who's awake You're a cruel, cruel man, Salem.

Member Avatar for Narue
0
147
Member Avatar for spankyg

>Microsuck Do you think you can do better? If not, you have no right to throw around insults. >but it seems like you have to learn a whole language when dealing with Visual Studio! You probably just haven't done much Windows programming, or much programming at all, come to think …

Member Avatar for Narue
0
129
Member Avatar for weasel7711

>I'm slightly confused as to why the unsigned char makes a difference? toupper takes an integer parameter, but that integer is required to be either EOF or in the range of unsigned char. Because sent holds values that you can't be sure fit in that range, a cast forces the …

Member Avatar for Narue
0
191
Member Avatar for NatalyC

[url=http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_sorting.aspx]This link[/url] is a vain attempt to help you, even though I'm reasonably sure you're beyond help at this point. >Please help me, this homework is for tomorrow So...you have an assignment due tomorrow on sorting a linked list and you have exactly [b]zero[/b] code that even attempts to sort …

Member Avatar for NatalyC
0
99
Member Avatar for Back door daddy

Reading from a file is just like reading from the keyboard. Let's say you want to read the first two records, you would do it from cin like this (if you were me): [code=cplusplus] std::string month; // Read the month if ( getline ( std::cin, month ) ) { std::cout<< …

Member Avatar for Narue
0
60
Member Avatar for abhishekgahoi
Re: op

And? Do you have a question or are you just posting trivial yet sloppy code to waste everyone's time? I see a disturbing trend in your posts. Maybe you should acquire a compiler and run these programs yourself.

Member Avatar for Narue
0
31
Member Avatar for mrb260478

Rule 1) A pointer isn't an array. Just because you say int *x doesn't mean you can immediately use x as if it were an array. You need to allocate memory to it first. Rule 2) main returns int. Rule 3) Don't try to use the file positioning functions until …

Member Avatar for Narue
0
149
Member Avatar for rugae

>Also plan to use class in lieu of struct. That changes the semantics. class and struct are similar, but not synonymous.

Member Avatar for Narue
0
127
Member Avatar for aaabhish
Member Avatar for Salem
0
164
Member Avatar for n.aggel

>How can i see the assembly produced by the compiler{if it is possible}? You can add a switch to most compilers that tell them to produce assembly output. >Where does the compiler makes a better job than the programmer? Unless you're a good assembly programmer (and in some cases a …

Member Avatar for n.aggel
0
160
Member Avatar for skatamatic

>How do you clear the console screen without any system-compatibility issues? Start by altering reality such that standard C++ recognizes a "screen" and a "console" in a convenient way. >but this is for a computer engineering course I'm impressed. Most programming courses actually take the opposite stance when it comes …

Member Avatar for WaltP
0
2K
Member Avatar for Azurea

>but I haven't been able to find any compilers for it. You didn't look very hard, did you? A search for "C++ compiler" brings up a number of immediate hits, and a simple search of this forum would give you all of the popular ones. But no, you had to …

Member Avatar for ithelp
0
119
Member Avatar for Ratte
Member Avatar for toxic

>I never said memcpy() wasn't standard. The implication was there. Just think of it as adding to your answer rather than correcting you. >If not, you may very well be playing with fire to try reading >(or writing) past the end of memory you have not allocated. I don't even …

Member Avatar for Duoas
0
17K
Member Avatar for jammy's

I can think of a few definitions for "trace". Can you be more specific?

Member Avatar for Fast
0
98
Member Avatar for aswinikg

>Is it possible for me to use "FILE" pointer concepts in my programming. It really depends on what kind of embedded program you're writing. If this is a freestanding implementation (not hosted by an OS), you're not guaranteed to have the stdio library at all. In that case if you …

Member Avatar for aswinikg
-1
81
Member Avatar for grunge man

Even the worst book on C++ will will cover such topics as arrays, and we don't particularly enjoy explaining things that are covered in great detail in *every* available reference. For a quick overview, try surfing over to wikipedia and search for arrays.

Member Avatar for shuncyk
0
152
Member Avatar for aus_fas1

>> Second. the sizeof requires parentheses. >Wrong again, it only needs () when it's a variable name, not a type name. It's the other way around. sizeof requires parentheses with a type name, but not a variable name. >1. Arrays in C/C++ are managed by having a variable that points …

Member Avatar for aus_fas1
0
249
Member Avatar for The Dude

>I am strictly a cash person! Credit cards are evil, an easy way to trap stupid people! I think that makes you a stupid person. You have to build good credit if you want to buy a car, or a house, or rent an apartment. An easy way to do …

Member Avatar for Lardmeister
0
242
Member Avatar for DREAMER546

>after i write this program there's error i don't know why ? It's customary to post the error as well as the code. Most of us can tell you what's wrong by reading the error, but if we only have the code we have to read it carefully or compile …

Member Avatar for DREAMER546
0
111
Member Avatar for nitro

This isn't a free homework service. You're supposed to write the code yourself, and we can help you make it work. But don't expect freebies.

Member Avatar for Narue
0
60
Member Avatar for noona

>there's a problem with compiling this code Of course, it could also be the syntax errors. >so how am i supposed to change class vector in order to make it compile? Maybe I'm missing something, but if you want to change the contents of your object, you shouldn't have declared …

Member Avatar for Narue
0
96
Member Avatar for Narue

I've been writing my own implementation of stdio.h whenever I get a few spare minutes recently. Nothing fancy or thorough, and without wide character support, it's hardly conforming. But I was looking at one of my intermediate versions of printf and could only marvel at how ugly it was. So …

Member Avatar for Duoas
2
178
Member Avatar for JaksLax

[code] void quicksort(int theArray[], int first, int last){ int pivotIndex; if(first < last){ //create the partition: S1, pivot, S2 partition(theArray, first, last, pivotIndex); } } [/code] Hmm, methinks you're missing something. ;) Why don't you try starting out with a working recursive quicksort (I posted a code snippet that's a …

Member Avatar for JaksLax
0
238

The End.