51,593 Topics
![]() | |
How can I read integer by ifstream from a file 2 3 -5 9 -6 Besides, how can I read the negative sign also? Thanks everyone!! | |
Hi, I m trying create a COM Server EXE(C#) from my VC++(dll). The problem is when my dll is in Admin privilege and when i try to do a CreateInstance of my C# EXE it's created with same privilege(admin). I m trying to figure out how to Create my COM … | |
So I got past my last problem using new[], but now I seem to have a new one... I created a char***, var. The goal was to build each dimension of the array to be different sizes at different times, based on separate user input... Here is the code: [code=cpp] … | |
Well people... I already know that c++ is not what I want to do in the future, but I do have to pass this class. That said, I need help with this array. I understand how they work, but my instructor wants us to use them in a function!!!!! I … | |
Hi, I'm having issues with a program that concept-wise sounds very simple. The program should read in data from a text file (attached a2.txt), and perform stack and queue operations upon the data. The data consists of long math problems, dealing with order-of-operations. The correct output that should be appearing … | |
I have a few assignments to get done, but I figured I'll post one to see if I'm the right track. If so then what I did will greatly help me. Here are the requirements [quote]Create a simple Dog class that has the following private fields (age (int), gender(char), name(string), … | |
Hello, I have a problem (error) the error is : [QUOTE]a.c:354: error: ‘hton1’ was not declared in this scope [/QUOTE] and the code is : [url]http://wklej.org/id/52405/[/url] What is wrong ?? | |
I have been giving the task of making a box using all asterisks, given an input of say 5. Im supposed to make something that resembles a 5x5 box with nothing in between... I am stuck at a dead-end here and any help would be appreciated! My code so far … | |
Hi Everyone, I have a webBrowser written in c# that displays webpages. I want to add a button to the webBrowser that will increase the size of the text on the webpage when it is clicked. Any help with this will be greatly appreciated. Thanks in advance SubProf | |
I just have one question, when you have a class that is defined: [code=C++] class box{ public: int *value; box() { value=new int; *value=0; }; box(box &c) {*value=*c.value;}; }; [/code] If in the main you said class box b(a); it would work as expected. But I don't understand how that … | |
Ok, I know how to overload an operator. I have successfully overloaded +, -,=, * for a matrix class. I am trying to do inversion of a matrix. I have the code working for the inversion but I do not know how to properly overload the function I want. I … | |
I have written some code to dynamically allocate memory for a 2D matrix. I am using overload operator to perform functions on the matrix naturally. I am having memory issues (Unhandled exception at 0x... Access violation reading ...). Here is my class, header, and main code. The code builds fine … | |
Hi, I wish to read the file twice. I am using ifstream to read the file. I tried using rewind(File pointer). But i get an error. How can i do it. Thanks | |
Hi, I've wondered this for some time now. Say function A() returns a char* which points to a string.. obviously Say function B(char* szString) takes a char* as its argument. If I call B(A()).. is the string automatically deleted or will it create a memory leak? Thanks | |
A friend convinced me to store a vector of pointers in my class: [code] vector<Point*> Points; [/code] In my class instead of a vector of "real" objects (what do you call this?). The problem now is that there are several functions (out of my control ie. in a library) that … | |
I have a title that is read in from the keyboard. I need to put it in quotation marks but i dont know how to do that...for instance, my program asks the user to put in a movie title and they input the title. Then i have to display the … | |
this is my struct [CODE] struct CropType { string crop; string farmer; string color; string order; }; CropType myCrop; [/CODE] and this is my tree [CODE] struct TreeNode { CropType info; TreeNode* left; TreeNode* right; }; [/CODE] how do i compare a string within my struct like crop to a … | |
Hi, I'm trying to get [URL="http://www.cgal.org/"]CGAL [/URL]working with VS 2005. So, I installed the [URL="http://www.boost.org/"]Boost [/URL]libraries as well as CGAL and tried to run the following example program: [ICODE]// file: examples/Polygon/Example.C //-----------------------------------------------------------------------// // This is just a simple example that demonstrates how to use the // class CGAL::Polygon_2. //-----------------------------------------------------------------------// #include … ![]() | |
i have to use an array for this and when i run my program my computer starts to spit out number can someone help me. the critia is that it can read from base 2-9 and will give me the answer in base 10. [code] #include <iostream> using namespace std; … | |
I am recently writing a doubly link list by C++ However,I don't know how to perform shuffle as the following: Places all the nodes in odds positions before that in even ones. For example,after executing shuffle, the list {a, b, c, d, e} will become {a, c, e, b, d} … | |
Hi, I have recently jumped into the realms of C# and I am having some trouble with editing properies accross threads. From what i have managed to research thus far i beleive i need to use the Invoke() method, however i am not quite sure how to go about this … | |
I need some help with a project. I'm trying to print out all possible combinations of a number grid. For example: 1 3 2 5 4 2 4 3 1 5 5 3 4 2 3 4 3 1 5 2 5 3 4 1 2 The numbers are randomly … | |
I am trying to right align my numbers to make them look like this: [TEX] Total Collected: $ 26572.89 Sales: $ 25068.76 County Sales Tax: $ 501.38 State Sales Tax: $ 1002.75 [/TEX] The problem is i dont know how to format it in my code. Here is my code … | |
Hi! This is my first post here :) and I'm not good with english :) I hope that you will understand :) I'm trying to enter a string with only numbers. I solved this but i dont know how to enable delete (backspace button) ? I solve and this problem … | |
My task is to write a command line program, which has to try and delete a file which is in use. The reason for this is because I am writing a tool which is used for removing malware, and it is very time consuming to have to load up a … | |
I tried to search for other threads to answer my question but couldnt come up with anything that I could think of to describe what I was looking for well. My assignment is this: Write an application that shows the sum of 1 to n for every n from 1 … | |
I have a function that I call recursively, but I want to keep track of a maximum through the entire process. This is what I am doing: [code] void Intersect(double &MaxDistance) { if(something) MaxDistance = something; Intersect(MaxDistance); } [/code] Is that correct/reasonable? Something doesn't seem to be working and I'm … | |
Game description here:[url]http://www.google.com/url?sa=t&source=web&ct=res&cd=11&url=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FBreakthru_(board_game)&ei=dXeTSZH9KJmatwe2i_DiCw&usg=AFQjCNGMFXvDxyuxmi8PrdyGneGpX5SNRA&sig2=pdq6w2j03qSNW-9gQio83g[/url] Variables/functions needed to be known: m_count: turns taken (0,1,2) x,y starting coordinates of a piece h,v destination of said piece get() returns integer 0,1,2 [empty,gold,silver] sideSwitch() resets m_count to 1 and turn to the opposite player. ___ [B]Problem:[/B] First pieces started disappearing: fixed game wasn't ending when … | |
Hi people. I have this code and I am stuck on trying to get a 'call by reference' to work properly. I need to convert Celsius to Fahrenheit and Fahrenheit to Celsius. I am not sure what is wrong with my code. Remember that I have to use a function … | |
Hey I want a code for a please wait with dots in front of it (writes some and delete them and starts again) or a / or \ that rounds. thanks | |
Hi, I tried creating multiple bitmaps on top of each other but cant seem to get the result i want: currently i have one bitmap that is the background and another bitmap that is supposed to be an animal and will be on top of the background. this is my … | |
I have to write a code in Native C++ using which i have to load the contents of an XML into GUI and write back the changes done (pertaining to parameters) into another xml which is a replica of the loaded XML. The usage of TinyXml is a must. Please … | |
Hi, I am a beginner of C#. Currently, I am doing a project of capturing image from a 1394 camera and I used the CMU 1394 camera API to get image from it. As the API is written in C++, is it possible to use in C# by using the … | |
Hi, I am designing a class having interlinked object...a sort of tree. The code for each element of tree looks like : [code] Class C; class Element { public: int key; string payload; C * next; }; [/code] But the object of Element is becoming too heavy because of use … | |
Am a final year student of an institution, i need a computer science based project topic and someone to put me through too. Please help me, is urgent !!!! | |
Hello! i got this code. However i'm really not familiar with memcpy function. Can anybody can show me the other way to write that code without using memory function? [code=cplusplus] void rightRotate (int k, int n) { char temp [2*MAX], *saveptr; saveptr = num+k; // cout << "k" << k … | |
Hi, I am using Windows Vista as operating system and Microsoft Visual C++ 2008 Express Edition as an compiler. I need a matrix library.Could you suggest me any library that I will easily configurate and link with my compiler. For example I need to take square root of a matrix.Because … | |
Peace be on all the readers, i want to read a dbx file from Outlook Express in C++ or even in C#. But i dont know how to do this. Can anyone help me please !!!!!!! | |
asked to do something that is I suppose a little strange. maybe because it's out of the blue and never tried it before. Essentially take a .txt file and split it up into 4 files. (no criteria on size, readability etc.. etc. ) Just split it up.. give each a … | |
(I have installed both MSDN and VC++ 2008 Edition How do I access MSDN? Thanks all | |
Hello all! I am getting my feet wet at working with ftp. I am working with the WinINet library. This is what i have so far: [CODE=syntax] #include "windows.h" #include <iostream> #include "wininet.h" using namespace std; int main() { const char* apphndl = "ftper"; char* wrkingdr; DWORD buffer[100]; HINTERNET handle,handle2,handle3; … | |
Ok, what i'm wanting to do is read a variables from another process ( not modify it ....just read it and output it) so e.g. test.exe: int main(){ int test = 1; return 0; } how would i write a program to read from the process (test.exe) and check what … | |
I get this error message while I'm trying to use copy constructor, I understand why the error message is showing but I don't know how to resolve it. #include <iostream> #include <iomanip> #include <fstream> #include <sstream> #include <string> #include <ctime> #include <cmath> #include <vector> #include <cassert> using namespace std; class … | |
Hi, I have read about using sprintf and tried it but can't make sense of how it works. I have a double with the value 16.525 . I want to cout only 16.53 I also tried setprecision() and it just cuts off the 5 on the end which won't display … | |
I'm trying to get info about users in Active Directory using C++. In particular, I'd like to retrieve the EmployeeID property, but it doesn't seem to work. I know for sure one user has a value for the EmployeeID. If I look for FullName or LastLogin, I get the values, … | |
I'm trying some code with classes but get these errors: overloaded member function not found in 'Point' 'Point' : no appropriate default constructor available [CODE]#include <iostream> using namespace std; class Point { public: Point(float f_x, float f_y, float f_z); private: float x, y, z; protected: }; Point::Point() { cout << … | |
[code=cplusplus] #include<iostream> #include<list> using namespace std; int main() { list<int> dob; for(int i=0;i<5;i++) { dob.push_back(i); } for(int i=0,list<int>::iterator itr=dob.begin();i<3;itr++,i++) cout<<*itr; return 0; } [/code] errors-- test.cpp: In function `int main ()': test.cpp:17: `iterator' specified as declarator-id test.cpp:17: extraneous `int' ignored test.cpp:17: `int list<int, allocator<int> >::iterator' is not a static member … | |
Hey everyone, I'm very new to c++ and need some help with overloading operator= for a polynomial class. Here's my relevant code: [CODE] // i can't change the method signature as it is required this way polynomial& polynomial::operator =(const polynomial& rtSide) { this->nullify(); // a method to reset variables polynomial … | |
As I know Radix sort is ideal for numbers but does radix sort applicable for sorting words also?:S,can you give me small ideas how to do that? :icon_confused: | |
Hi, I have class X and class Y such as the following; [code] class X { ... void foo(); ... } ----------------------------------------------- #include "X.h" class Y { void hoo() { X myNewX; myNewX.foo(); } } int main() { X newX = new X(); } [/code] When I do this, it … |
The End.