Posts
 
Reputation
Joined
Last Seen
Ranked #417
Strength to Increase Rep
+7
Strength to Decrease Rep
-1
89% Quality Score
Upvotes Received
35
Posts with Upvotes
29
Upvoting Members
26
Downvotes Received
5
Posts with Downvotes
5
Downvoting Members
2
15 Commented Posts
1 Endorsement
Ranked #858
Ranked #540
Member Avatar for rfrapp

[QUOTE=rfrapp;1722891]I see that the square, in this case, is a 9 x 9 square, and that each descending number appears as a multiple of 8 (There are 8 4's, 16 3's, 24 2's, and 32 1's), but i'm not sure of any other patterns. Im sorry, I'm not much of …

Member Avatar for pty
0
1K
Member Avatar for benbee

Every appliance has a watt rating listed on it somewhere. Watts tells how fast the electricity is being used, that is, at what rate. It's like a faucet that's running water, the "watts" would be the number of gallons coming out of the tap per minute. Turning the facuet on …

Member Avatar for luff
0
766
Member Avatar for MandrewP

Hello, I'm trying to create a data area within an .exe file. Then I will open the .exe file and scan it for the data area. When the data area is found, I will write some data to this data area and write the .exe file back to disk. I …

Member Avatar for rubberman
0
118
Member Avatar for MandrewP

Is double pre-incrementing undefined behavior? Like ++++x or even ++++++++x. I think it must be since it all occurs between sequence points. But what could possibly go wrong? Or do you just not ask that question and automatically stay away from any undefined operations? Is double incrementing ever routinely used? …

Member Avatar for shahid_650
0
200
Member Avatar for Learner010

**b=a++ will first initialise value of a to b then a get incremented** should actually read: b=a++ will first initialise b to the value of a then a gets incremented.

Member Avatar for Learner010
5
684
Member Avatar for saurav2007

Here is a slightly modified version of your code (in the function **fun**): #include<iostream> using namespace std; int& fun() { static int x = 10; cout << "In fun x = " << x << endl; return x; } int main() { fun() = 30; cout << fun(); return 0; …

Member Avatar for Ancient Dragon
0
277
Member Avatar for gcardonav

> then whats the difference between using namespace and #include? doesnt #include also tells c++ to go look in this header file for this function or statement...Quoted Text Here No, it doesn't tell the compiler to go look anywhere - the header file is simply "included" in the source file. …

Member Avatar for StanleyLau
0
4K
Member Avatar for amirul_1

Of course, you will need to be able to determine if the integer is even or odd. Can some mathematical operation (add, subtract, multiply or divide) be done on the integer to determine if it is even or odd? (The answer of course is yes : )

Member Avatar for MandrewP
0
116
Member Avatar for pars99

Generally, you connect C++ code to circuitry by storing it inside a memory. Then some circuitry will read that code line by line and do what it says. A microcontroller is like that, it's a computer on a chip and will be under the control of the code stored in …

Member Avatar for mike_2000_17
0
2K
Member Avatar for alex9620

As a program gets more complex, it's a good idea to use prototypes. One reason to use prototypes is because it makes it easier to see what parameters any particular function uses. If all of your prototypes are in alphabetical order and listed one after the other, it's easy to …

Member Avatar for MandrewP
1
390
Member Avatar for ringo861

Declaring variables is to create them which brings them into existence. You have to specify the type of variable that you are creating. There are different types because there are different types of data to be represented. For example, there are integers which are simply whole numbers (like 1,2,3, 86, …

Member Avatar for MandrewP
0
260
Member Avatar for AmerJamil

Once you change fstream.h to fstream the program reads the file (for me anyway). If it still doesn't read the file for you as you stated, then there is another problem unrelated to "using namespace std" and "fstream". Maybe your doc.txt file is not in the right path and so …

Member Avatar for deceptikon
0
953
Member Avatar for tomz6

Well, consider this: When you pass a pointer to a function, that pointer is being passed by value. So which is faster, passing a pointer by value or passing a value by value? I don't see how a pointer can be faster. If I am figuring this right, when the …

Member Avatar for Banfa
0
993
Member Avatar for chocolatte.lavista

In line 40, in your function box_vol, the two identifiers "l" and "w" are strangers there. Once you are inside of the function, there is no way to see outside of it. So any mention of "l" and "w" outside of the function is not observable from within the function, …

Member Avatar for asifalizaman
0
354
Member Avatar for harry.lloyd.7503

You don't just write some code to send a HIGH output to a USB port. In days gone by you could simply write some code to send a byte to the parallel printer port, or more commonly to a serial port (com1 or com2). But things have gotten at lot …

Member Avatar for MandrewP
1
252
Member Avatar for hitman007

I miss Narue. I wish she would come back and give us a piece of her sassy mind.

Member Avatar for Chickzer
0
248
Member Avatar for Asmaa_2

This code: **cout<<(x=(x>='A'&&x<='Z')?x+=' ':x-=' ')** works like this: if(x = capital_letter) cout << x + 32; else cout << x - 32; Because this kind of "if" construct is used so often, the designers of C developed this statement using the conditional operator **?**: x = (test condition) ? 5 …

Member Avatar for MandrewP
0
494
Member Avatar for SeePlusPlus2

The right most digit is the 1 or 0 that is being compressed, and the remaining 3 digits to the left code how many of those 1's or 0's there are. 1011 = 101 1's - i.e., 5 ones. 1110 = 111 0's - i.e., 7 zeros.

Member Avatar for SeePlusPlus2
0
181
Member Avatar for christinetom

> If I have a function such as Funct(int *arg1, int *arg2) , how do I use this function in a program. > You use this function the same way you use any function, you pass the specified parameter(s) to it. If the two parameters are pointers (to an int) …

Member Avatar for Gonbe
0
143
Member Avatar for pars99

In line 13 you are assigning the value of **triangle** to **shape1**. The problem is, **triangle** doesn't even exist (at least not at this point) so the compiler is complaining that **triangle** has not been defined (i.e., brought into existance).

Member Avatar for pars99
0
2K
Member Avatar for candicecandy

Sorry, you have to help yourself first. Make an effort at writing the code yourself, and post it here so we can see it and help you to carry on.

Member Avatar for Schol-R-LEA
0
222
Member Avatar for slygoth

Basically, what you could do is just declare your three variables in main(), since that is where you want them. Then, with the long arm of your function, reach all the way over into main() and manipulate those variables directly. You do this by passing a **reference** or **pointer** to …

Member Avatar for Despairy
0
197
Member Avatar for s123456

Look at your **if** statements - at least one of them has to execute in order to *not* print twice. So if there is a double printout, then neither **if** executed, thus both **elses** did. Frankly, I think something else is going on somewhere else in the code which isn't …

Member Avatar for MandrewP
0
146
Member Avatar for abhishekbalaji

Windows will keep an eye on your data accesses and if you go outside the bounds of your program's allocated space Windows will shut it down ("Your program has encountered a problem and needs to close"). Because Windows is a multitasking operating system it won't allow a program to mess …

Member Avatar for MandrewP
0
127
Member Avatar for Mncedisi

> You are asked to write a program that manages a company's stock... So ..... what's the hold up?

Member Avatar for Iyfjeyeon
0
180
Member Avatar for FreddyGIraheta

if(true) do_this; else if(true) do_this; else if(true) do_this; else if(true) do_this; else if(true) do_this; This is called a decesion tree, and only one if statement will execute out of the whole bunch. When one of the if statements does execute, then control drops out to the bottom bypassing all the …

Member Avatar for MandrewP
0
106
Member Avatar for prince.chindah

Well, if you really want to learn, then I think we should start learning the basics of electronics, since computers are electronic. Once you know some electronics, we can breadboard some simple digital circuits, like “and" and “or” gates and some simple adders and flip flops, counters, etc. Then we …

Member Avatar for MandrewP
0
178
Member Avatar for bdl365

Also, whatever algorithm you use to generate lines 1 - 4 you may be able to use for lines 6 - 9 by just reversing the "direction".

Member Avatar for WaltP
0
274
Member Avatar for Albino

Maybe strings are giving you errors because you forgot to declare them - just like you forgot to post your code.

Member Avatar for Ancient Dragon
0
166
Member Avatar for brian.ediger1

Each of your two .cpp files are treated as separate source files by the compiler and are compiled separately. In each source file you have included "Resistor.h", and thus in each source file those objects in "Resistor.h" are created. No problem until the linker trys to combine the two compiled …

Member Avatar for brian.ediger1
0
210