49,761 Topics
| |
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 … | |
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) … | |
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 … | |
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 … | |
[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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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]; … | |
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 << … | |
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. … | |
So are there any good piping & threading tutorials out there? | |
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 … | |
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 … | |
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. … | |
[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? | |
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 … | |
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 … | |
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> … | |
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 | |
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 … | |
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 … | |
[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; … | |
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 … | |
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 … | |
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, … | |
Hi all, how can I disable internet in windows/Linux machine. I want to disable completely and enable it at will using C++ Thanks |
The End.