49,764 Topics
![]() | |
Hi, I have prolly very noobish question. I compile my program separately with GCC by: [CODE]gcc -O2 -Wall -c foo.c[/CODE] I just wat to ask if there is a chance to specify the output destination of [B]foo.o[/B] file. Now the output is forwarded to the makefile dir. Thank you for … | |
Say I have this code: [CODE]BOOL WINAPI ActivateActCtx( HANDLE hActCtx, ULONG_PTR *lpCookie ); DWORD WINAPI EnumerateLocalComputerNamesA( COMPUTER_NAME_TYPE NameType, ULONG ulFlags, LPSTR lpDnsFQHostname, LPDWORD nSize ); [/CODE] And I need a C++ script to automatically turn thousands of those into something like this: [CODE]BOOL WINAPI ActivateActCtx( HANDLE hActCtx, ULONG_PTR *lpCookie ) … | |
Make a program that: a)create / read prepared text file with random figures b)search the pointed from the user value with the method with search step c)demand is realized with two different steps 2 <= k <n d)count comparisons during the search in both cases (for both values of k) … | |
I need help figuring out if two numbers are co-prime. So far I have this (prime() is a bool function) [CODE]void GetE(int& e, int& result) { int random = rand(); do{ while(prime(random)) { if(random < result) e = random; else random = rand(); } while(!prime(random)) { random = rand(); } … | |
I have to write a slot machine program where theres 3 wheels. wheel 1 = cherry, cherry, cherry, plum, plum, bell, bar wheel 2 = cherry, cherry, plum, plum plum, bell, bar wheel 3 = plum, plum, bell, bar, cherry cherry. when wheels "spin", output should show three items from … | |
Hey guys, I written a base class (AudioTrackElement), and derived a class from there (Looper) and another (VolumePan). The looper class implements functionality, while the AudioTrackElement is there just so I can hold many Loopers and VolumePan objects in the same vector. The problem: I can create a [icode]std::vector<AudioTrackElement>[/icode] no … | |
My assignment asks me to Implement a Linked List class with FoodItem as the objects to be inserted in the class, and implement a PrintList function member that prints the name of each food item in the list. Implement a SelectPrint function member that only prints the food item names … | |
[B]Program goal[/B]: user input for 2 equations to evaluate the operator signs. i.e. 1 * 2 + 4 - 4 and 5 - 2 * 6 + 9 would be the same --> " * + - " in both, order does not matter. [B]Output[/B]: cout saying match or not … | |
hi , i have this assignment but i don't know how to find the structured ? the program needs to use the structure that stores the following data: Drink Name Drink Cost Number of Drinks in Machine and we need to create an array of 5 structure with this: Drink … | |
Hello! I'm trying to alter a raytracer program which is supposed to create a picture of 25 spheres. It's an exercise in optimization so I'm basically trying to make the program run without any unnecessary code, making the program specific for the intended output. I'm using a C++ array to … | |
Hi, I am engineering student, currently working in a project in the field of image processing. Project would involve extensive use of MATLAB or Open CV. I have past experience of working in project involving mobile application development and subsequent deployment on mobile platform. I would like to discuss various … | |
Our professor ask us to upload our program in a website, I've been searching through the web with possible ways, but I still can't figure it out how to do it. Do we have to use the .cpp file? There's another problem, I a trying to run the "Application file" … | |
Hi! I need to write a program that moves some letters to the end of a word for example if i enter : cook look book telephone, the result would be: ookc ookl ookb elephonet. i came up with some code but then my ideas run aout...some help would be … | |
Hello all. I'm trying to compile a socket program in DevC++ but everytime I do it I get a lot of linker errors like these: [CODE] [Linker error] undefined reference to `WSAStartup@8' [Linker error] undefined reference to `htons@4' [Linker error] undefined reference to `inet_pton' [Linker error] undefined reference to `socket@12' … | |
Hi guys, i need your help i new to this homepage and im learning c++ i've got homework about this weekend to create something like that: [B][U]Give your Informations (<FirstName> <LastName>, <dd.mm.yyyy>)[/U][/B] now i want to ask you how to check with c++ if a string got a "," would … | |
Hello, im trying to implement a generic double linked list, and i have added just one function(insert). But im getting some errors. Here is the code: [CODE]#include <iostream> #include <cstdio> #include <string> using namespace std; template <typename T> class doubleList { private: struct Node { T info; Node *leftPtr; Node … | |
How do I write a a recursive function that counts the number of sequences that sum up to that number (user input)? | |
I have a problem printing the winners in my Voting Program. Please help me finish it. [CODE]#include <iostream> using namespace std; void DisplayOptions(); //void DisplayOptionsVice(); int InputVote(); int UpdatePoll(); void DisplayPoll(); //void DisplayPollVice(); int VoteArray[5]; //----------------------------- void main() { int option; int loop; int ctr=0; for(loop=0; loop<6; ++loop) { VoteArray[loop]=0; … | |
i am not sure why the value of b is coming out as 0 according to me it should come out as 3 [CODE]#include <iostream> using namespace std; void read(int a[],int n) { for (int k = 0;k < n;k++) { cout << "enter the " << k << "th … | |
For class I have to use a stack to find if a word entered by the user is a palindrome... [CODE]#include <iostream> #include <string> #include <stack> using namespace std; int main() { char *word; int count; stack <char> mystack; stack <char> rev_stack; cout<<"Enter a string "; cin>>word; while(*word!=NULL) { mystack.push(*word); … | |
Arrays are passed by reference (address) by default. Function takes an array and tries to return average, sum of elements, and the sum of the squares. Calculate and display sum, sumsq using for loop in the function definition display sum, avg, and sumsq to see the difference between the values … | |
I have made... well attempted at making a unique random number generator using arrays and functions, but it still will not work and I cannot find my error at all. Can someone please help? T_T [CODE]#include <iostream> #include <ctime> using namespace std; // *****Function prototypes**** void displayArray(int randNum[], int elements); … | |
My problem is to make a program that stores a High temperature and a Low temperature within a two dimensional array and then displays the Average. I can get the numbers to be stored(I think, but the average doesn't work at all it seems to display the last number entered … | |
Hi, I'm having to write Conway's game of life for school and I'm having a little trouble with it. Whenever it runs through the code, all of the 'cells' move to the left a bunch and warp around the screen.. I'm not sure why.. Any help would be great! Thanks! … | |
I need to create a ResistorClass overloaded logical OR operator function which shall do the following: Overload the logical OR operator ( || ) to calculate the equivalent parallel resistance of the nominal values ( m_dptrRes[0]) of two Resistor Class objects. The formula for calculating parallel resistance is: NominalValue1 * … | |
Hi I need help!! My program is supposed to count word occurences from a text file and the output is supposed to look like this a 2 count 1 hello 1 test 2 this 1 words 1 but instead it does this : a 2 a 2 count 1 hello … | |
I have created a histogram program that has the user enter the lower limit of the range, then generates a 20 number array with that number at array[0] and the lower limit + 20 at array[20]. It then does a random number generation where 85% of the randoms are within … | |
Hey; I am having problem with the read and write functions in fstream. They need to have a const char * to read or write from/to buffer. I need to work with integers. Here what happens: [CODE]for(int i = 0; i < numberOfValues; i++) { int random = rand() % … | |
Well, i'm really new to this programming thing, but i don't have a teacher or anything like that, i'm an autodidact so I really have a lot of questions on this matter. I'm trying to do a project using Augmented Reality. As far as I know, there are two main … | |
[CODE]cout << "The sum is " <<sum<<endl<<"The sumCheck is "<<sumCheck<<endl; if (sum==sumCheck) { cout<<"Is a polygon"<<endl; } else { cout<<"Is not a polygon"<<endl; } [/CODE] The sum is correctly displayed as 360 and sumCheck is correctly displayed as 360 yet the message "Is not a polygon" is displayed. I can't … | |
Hey all, I'm creating a text-based RPG and am just now getting to the fighting mechanics. I want to use the rand function to choose a random number within a certain range but am having trouble getting it to execute correctly. [CODE]#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; … | |
I need to compress monochromatic bitmap with modified huffman algorithm here's the algorithm: [url]http://www.iet.unipi.it/m.luise/HTML...n%20Coding.htm[/url] as you see i need to replace pixel (bits) sequence with some bits sequence variable length so im not sure which type to use for bits manipulation iI found this class for bits [url]http://www.codeguru.com/cpp/cpp/cpp_...nipulation.htm[/url] and this … | |
Hi, I have a method call say some fucntion that takes in a pointer of an array of char [CODE]char anArray[32]= {'1', '2', '3', '4', '5', '6'}; // the function call someFunction(&anArray[0]) [/CODE] I don't think I have quite grasped the concepts of pointers yet, does the code i have … | |
I'd be interested to hear your views on which IDE is best for developing in C++ - Eclipse orMS Visual Studio. What are the positives of each and what are the negatives? Many thanks Mairi | |
[COLOR="Red"][U]Need Help Making Keylogger[/U][/COLOR] Hi everyone, My name is hayzam and i want to make an advanced keylogger and what to put it in a USB So when I connect my usb it will open automatically and it must be invisible one more thing i am a newbie to C++ … | |
Hi! I have a program I'm working on for class (CSC 150). I have to read a pgm file into an array, copy it to a second array, manipulate the image and then output to a second file. I'm having a heck of a time figuring out how to do … | |
I have to load two arrays, merge the two arrays into a third array, then create a control break report on name while outputting the most frequent style, then sort the array by style and to a control break on style. Can someone look at my code and see if … | |
Hello, everyone. I'm having a hard time trying to figure out how to declare and initialize my dynamic array of objects. Here is the class definition and constructor definition: [CODE=C++]class SavingsAccount : public BankAccount { public: SavingsAccount(char, int, string, double, int, double=2.00, double=0.0, double=0.0); double getinterestR() const; double getaverageDailyBalance() const; … | |
i am trying to import into a 2d array the following: line one : gpa e.x.[2.3,5.1,....] ^ ^ | | line two : id e.x.[1 ,2 ,....] and after that to sort the gpa in a descending way but in the same time the id to follow each ones gpa. … | |
Hi, Im trying to run this program using dynamic memory i cant seem to get it to keep running it crashes on me. I have the working program so the code is correct im just haveing trouble trying to convert it correctly. Thank You, [CODE]#include <iostream> #include <fstream> using namespace … | |
hey guys, I am a beginner and am having trouble loading data from an external data file and then loading it to the screen. It is supposed to be the temperatures from everyday for a year for 2 years. 1 column is 1930 the other 2000 This is my script, … | |
Ok, so I have most of the code working but I've been up for over 24 hours and I just cannot seem to get the test score to come out. Here's my code, hopefully someone with fresh eyes can spot my error, I know it has to be something simple … | |
[CODE]void BinarySearchTree::inorder(tree_node* p) { if(p != NULL) { if(p->left) inorder(p->left); cout<<" "<<p->data<<" "; if(p->right) inorder(p->right); } else return; } [/CODE] This sample of code works fine if I use it to test valuables that are primitive, example: integer I wanted to be able to transform that, so, if for example … | |
My program runs, but I am getting this message which I am fairly sure means that I have a memory leak and it is coming from my destructor. Assignment2(779) malloc: *** error for object 0x100100120: pointer being freed was not allocated I don't know what I am doing wrong. Since … | |
what does error code -25922 means.. it is coming as a value of error in my programs line error = sPSActionControl->Play(&result, eventMake, desc000001B0, plugInDialogSilent); i want to know what this error code stands for.. please help me | |
I'm trying to move functions that I have created in my .h files into the .cpp files of my winForm application. I don't really know how to get this to work. Example code in .h: [CODE]void loadCustomerDetails() { SQLiteConnection^ ObjConnection = gcnew SQLiteConnection("Data Source=SwiftService.db3;"); SQLiteCommand^ ObjCommand = gcnew SQLiteCommand("SELECT * … | |
Hello! This is my first time attempting to get help but, alas, I'm desperate! I have been working on this program for a class (and it's due at midnight). I can't seem to grasp moving data in and out of arrays using nested for loops. it's a matter of entering … | |
Hi, I am writing a simple program modeling client/server interaction. I want the server to be capable of handling multiple connections. To implement this, I have been using _beginthreadex, passing references to sockets to the child thread. For example: [code]while(1) { SOCKET sClient = accept(ListenSocket, NULL, NULL); ... child = … | |
Hi all, I've built a Queue class which basically uses dynamic memory allocation to make an array grow with every new element inserted. It compiles and works perfectly under dev c++, but when I included the class in a VC++ 10 Express project and instantiated an object from it, the … | |
ive been told to put all my sql statement together but i jus keep getting lots of errors with local variables in my vc++ project. sql.h[CODE]#ifndef __SQL_H__ #define __SQL_H__ #include "stdafx.h" #include <iostream> #include <string> using namespace std; using namespace System::Data::SQLite; using namespace System::Data; using namespace System::Windows::Forms; using namespace System; … |
The End.