49,761 Topics

Member Avatar for
Member Avatar for Bigojac2000

A positive integer number n is said to be perfect if it is equal to the sum of its proper divisors. In other words, n is equal to the sum of its positive divisors excluding itself. For example, 6 and 28 are perfect numbers. Indeed, we have: 6 = 1 …

Member Avatar for strmstn
0
277
Member Avatar for photoyid

So I am working on a faux graphics program for class. The current part that I am working on is to determine just from top left and bottom right corners what the coordinates should be. I believe my logic is good but it seems to be setting it as tl(3,1) …

Member Avatar for WaltP
1
146
Member Avatar for munadel

In a C++ function How to check if the minimum and maximum values of an array are not equal and the minimum and maximum values of the array are not adjacent to one another. Also the minimum value occurs exactly once in the array and the maximum value occurs exactly …

Member Avatar for WaltP
1
108
Member Avatar for iamvish

Hi all, How to find free physical memory... I am using new operator to allocate memory.. I tried GlobalMemoryStatus (windows api) to analyse the current free memory. new is giving exception still GlobalMemoryStatus shows sufficient free memory.. I am using visual studio 2005 for development. and I want to avoid …

Member Avatar for WaltP
0
83
Member Avatar for clutchkiller

[code] #include <iostream> using namespace std; template <typename T> T total(T numValues) { } int main() { cin.ignore(); cin.get(); return 0; } [/code] Write a template for a function called total. The function should keep a running total of values entered by the user, then return the total. The argument …

Member Avatar for clutchkiller
0
942
Member Avatar for sikeufoo

I am a newbie to c++... Today I was handed a assignment on "array"...While working on this...I've met plenty of errors... I wonder where did my steps gone wrong... May anyone out there borrow me a helping hand?? [CODE]#include <iostream> #include <iomanip> using namespace std; float calpricetopay(int[5],float[5]); // function declaration …

Member Avatar for sikeufoo
0
106
Member Avatar for tajendra

In c++ pre and post operator are used with variables where one need to just increment or decrement value by 1.For incrementing value ++ operator can be used and for decrementing -- operator can be used. Its use is very simple one can easily say ++i or i++, to increment …

0
228
Member Avatar for marlowd

If you have some DACL permissions on a file, you can use SetFileSecurity() to change the permissions to something else, but what happens when someone deletes all of the DACL? Now you no longer have WRITE_DAC permissions, so you can not modify any discretionary ACE's to it. I have administrative …

Member Avatar for mitrmkar
0
99
Member Avatar for silvert122

Hello guys, i am trying to write an insertion sort program with any values entered by any users but im getting some weird numbers. could someone help me see what s wrong with my code. this is my code: [code]#include <iostream> using namespace std; int main() { int a,b,c,d,e,f; int …

Member Avatar for peter_budo
0
120
Member Avatar for rms360

i've done a of couple searches on this board and i haven't really found any answer to this. so- how can i get graphics into my c++ programs. From the books i've been looking through there aren't many, if any graphic commands, in the .net and visual c++ versions of …

Member Avatar for khalil88
-1
593
Member Avatar for squarey

Hi Guys, I am trying to write some regex to process a string. I have been reading up the boost documentation and noticed there are many differences between the way C++ regex is written and the way I am used to writing regex in web apps (J2EE, PHP etc). Can …

Member Avatar for Narue
0
81
Member Avatar for mattloto

I am preparing for a programming competition soon and for one of the sample problems one line of input is the length of the list of numbers and the second line is the actual numbers. this is what i have: void main() { int num; cin >> num; int items[num]; …

Member Avatar for Narue
0
122
Member Avatar for jch02140

Hi, I am still new to C++ and I am having a little trouble compiling the following code, and couldn't figure out what went wrong: [CODE]#include <iostream.h> #include <string.h> using namespace std; float x = 5.0f; int _65Num = 65; int mian() { string str = "Hello World!"; cout << …

Member Avatar for Fbody
0
176
Member Avatar for bhp2005

Having a problem setting user input to a dynamic array. It worked with a static array, but now I'm having some kind of pointer issue. The user sets the dimensions and enters in a number of characters, which should be set to the array 'gameboard'. it's just setting jibberish though. …

Member Avatar for bhp2005
0
168
Member Avatar for fox64
Member Avatar for fox64
0
29
Member Avatar for squarey

Hi Guys I was doing some reading up on data structures to refresh my memory when I came across the following: pmovie->title *pmovie.title source: [url]http://www.cplusplus.com/doc/tutorial/structures/[/url] pmovie is pointing to an instant of a struct. I know the arrow operator is a dereference operator for objects and I thought *pmovie.title was …

Member Avatar for Fbody
0
150
Member Avatar for iamvish

Hi all, How to find the free physical memory... actually i want to avoid the exception from new operator.. i have used the [B]GlobalMemoryStatus[/B] a windows api for this but new is giving exception still more memory available than i am allocating. I am using visual studio 2005 Please help …

Member Avatar for Ancient Dragon
0
163
Member Avatar for richman0829

This seems simple, but it's not working. There IS a text file in the same directory, but it's not being opened (and with the ios::in | ios::out, it should open even if it doesn't exist). I also ran into trouble trying to use infile.fail, which is why I used !infile. …

Member Avatar for richman0829
0
155
Member Avatar for avataralien

[CODE] try{int x = 0; cin>> x; if ( x > 100) throw 1; else cout<< “Good data”<< endl; } catch ([COLOR="Red"]int i[/COLOR]) { cout<< “Exception “<< i << “thrown”<< endl; }[/CODE] I need to know why the catch is int i & not int x?

Member Avatar for MyrtleTurtle
0
69
Member Avatar for ehsun7b

Hi I'm using [B]NetBeans + GCC[/B] in Linux and also [B]NetBeans + MinGW[/B] in Windows. I need to run an OS Command e.g.: [ICODE]java -jar myjar.jar[/ICODE] I prefer [B]not[/B] to have the terminal/cmd window. It works fine in Linux, but in windows, it ends up in opening a [B]cmd[/B] window …

Member Avatar for Nick Evan
0
214
Member Avatar for alexRivera

i've been having trouble just figuring out the merging part of the code. here's the main. everything works except for the merge part that is at the end of the code. [CODE] main() { HeapSort heap1; HeapSort heap2; int one, two; int x = 0; int number1,number2; cout<< " Enter …

Member Avatar for GrubSchumi
0
113
Member Avatar for marcelomg

Hello, I'm stuck with this code and I can't figure out how to make it work. I need to get the Sum of Odd numbers from an array. For some reason it returns 0. I'm new to programming, so any help would be appreciated, thanks. Here it is: [CODE]#include <iostream> …

Member Avatar for syd919
0
204
Member Avatar for dsa

Hi! I get an assignment where I should create c# wrapper class for sdk written in c++ which contains bunch of dlls, libs and hpp files. Can you give me some directions how shall I do it? I didn't have luck from google-ing. Regards, DSA

Member Avatar for kvprajapati
0
34
Member Avatar for harshareddy75

Hi all, Presently I am using winhttp api in c++ to get data from a server. The server can support various compression formats. So presently I want to use winhttp to get the compressed format (eg gzip) and decompress it. Is it possible to decompress the data using winhttp? thanks …

0
62
Member Avatar for techie1991

Hello, I was trying to implement data structures using file operations. I am using a data structure of two integers, one being the index number and other being the value. My actual aim is to recreate the file containing the data using a log. But, the program isn't running as …

Member Avatar for WaltP
0
471
Member Avatar for Bart_sg

[CODE]#include <iostream> #include <iomanip> #include <string> using namespace std; int main() { double V,I,pf,Ib; unsigned short int choice; int In = 0; cout<<"Please choose power supply type\n"; cin>>choice; switch(choice) { case 1:cout<<"You have chosen a single phase power supply\n"; break; case 2:cout<<"You have chosen a three phase power supply\n"; break; …

Member Avatar for tkud
0
141
Member Avatar for nola_Coder

I have an animated sprite animal character that runs across the screen using the arrow keys. It is a series of 7 individual frames. The first frame is its "sitting" position, which is as of now only called when the program starts. I want the animal to return to it's …

Member Avatar for nola_Coder
0
141
Member Avatar for riotburn

I am trying to find the yield of a bond given the bond price, coupon, and semiannual three yr bond using newtons method. The value for B in the output should about equal 101. I have checked everywhere for errors but cant find any. Any ideas? And yes I am …

Member Avatar for riotburn
0
148
Member Avatar for greatunknown

if I have a class... [code] class Note { private: string step; string octave; string duration; }: [/code] with the appropriate access functions, and then create a class [code] class Measure { private: vector<class Note> Measurenum; }; [/code] What is the best method to access the data (presumably step, octave, …

Member Avatar for mrnutty
0
105
Member Avatar for Stefano Mtangoo

Hi all, how can I disable internet in windows/Linux machine. I want to disable completely and enable it at will using C++ Thanks

Member Avatar for Stefano Mtangoo
0
90

The End.