49,761 Topics
| |
Hello, Im writing a banking system program for one of my assignments using classes, i've got the some basic stuff done but I can't for the life of me work out how to read data out of a file i've previously created and display it on screen. (I've cut the … | |
[CODE]// Project: XorLib - Xor Encryption Libary. // Copyright: Copyright © 2009-2010 Shadowscape Studios. All Rights Reserved. // Developer: Shadowscape Studios // Website: http://www.shadowscape.co.uk // Support: support@shadowscape.co.uk // Version: 1.0.0.0 // Release: 151220102240 #define export __declspec (dllexport) #include <stdio.h> #include <stdlib.h> #include <string.h> #include <windows.h> long filesize(FILE *f) { long … | |
[CODE] DynamicTypeList list; list.add(42); list.add("forty-two"); for (DynamicType* item = list.begin(); item != list.end(); item++) { if (item->what_type == item->is_int) { cout << item->integer << endl; } else if (item->what_type == item->is_string) { cout << item->string << endl; } }[/CODE] | |
I was reading a post somewhere on this site about making a type-dynamic list and came up with this. The issue is I'm thinking it's leaking memory when the list grows. Finally, are there any ways to improve this code? [CODE]#include <iostream> using namespace std; class DynamicType { public: union … | |
Hi! Im having a problem in the next line: i = socket.Receive(buffer) buffer is defined as: byte[] buffer = new byte[1024]; It crash when its waiting for the answer. In c++ im sending this: len = send(sock,"hola",4,0); Any idea? Thanks | |
Iam getting the error Heap Corruption Detected if i run the following program. If i comment out the line delete[], iam not getting the error. Also if i change the [B]outTxtStr = new char[outTxtLength + 1][/B] to [B]outTxtStr = new char[50][/B] iam not getting the error. Does anybody have some … | |
Final Edit: lol im dumb but the brackets backwards [CODE]#include <iostream.h> int main() { const int SIZE = 10; int numbers[SIZE]; int count1; int count2; int highest; int lowest; cout << "Enter an array of ten and I will find the highest and lowest" ; cout << " values" << … | |
Hi everyone, So I tried making my program here, and I got an error that I can't figure out. I have a class for a Binary Tree, "Stree", with a few methods defined publicly, and a "Node" class defined privately, within "Stree". These methods use "Nodes" as parameters. Now when … | |
Im writing a progam that calculate a person test score then prints out a letter grade bt i need to modify it so that the function "PrintGrade" actually keeps track of the highest score entered this is what I have so far... //This program reads a course score and prints … | |
Hi Daniweb, I've almost always found solutions for various problems before and have now decided to become a member so I can contribute as well. I would consider myself a so-so programmer (I understand classes, pointers, matrices, I/O, vectors, and of course structure). I am only able to make code … | |
Hi i have completed my assignment for my foundation degree, the details of the assignment are attached describing the C++ program which to be created, which is for a telephone company to log calls and give discount depending on the time of day and day of the week, and to … | |
I am having trouble with my print function for my linked queue. My compiler error is pointing towards cout << tempPtr->info << " "; line 149 tempPtr = tempPtr->next; line 150 in my print function. Can anyone help me fix this? Thanks CODE: [CODE] #include <iostream> #include <cstddef> // For … | |
Using Borland 4.5 I think I got most the program done but its hard for me to setup functions with returning names and values. Problems States: Winning Division: Write a program that determines which of a company's four divisions (Northeast, Southeast, Northwest, and Southwest) had the greatest sales for a … | |
hi guys, I am working on a project for my school, and I was wondering whether I can get some guidance and tips on how to tackle it. Here’s the problem in brief: I was asked to develop a program so that users can input the data values of 2 … | |
When you make sprites does the image file type have to be .png or can it be .jpeg etc.?? cheers for helping me out | |
Hey guys, I'm wondering if anyone knows how to write a function that draws a hollow triangle pointing to the right made up of asterisks. The horizontal width of the triangle is passed as a parameter. The statement triangle(4); would display a triangle 4 stars wide: [CODE] * ** * … | |
I am having an issue using this new operator function that I learned. The program thinks that I am calling the operator=() instead of the operator+() so it is hitting an infinite loop. I marked the areas where there are issues, and i commented some of the newer things that … | |
the code following this is my project. The getInfo() function will not return the information, that is one problem i have having. also anyone have a suggestion for a search function for this? [ICODE]#include <iostream> #include <string> #include <iomanip> using namespace std; ///////////// //Prototypes ///////////// void menu(int&); void getInfo(string[], int[], … | |
Does anyone know how to compare the first and second halves of a vector? I'm trying to write a function that returns true if the second half of a vector is identical to the first half of the vector. For example, if the vector contains { 3, 5, 2, 3, … | |
Hi! I'm writing the mergesort algorithm, theoretically everything is fine in it but when the function gets to call itself the program crashes. I belive that I'm doing something worng when I pass the vector<int> as a parameter to the function. [B]procedure mergesort(T[1 .. n]) if n is small then … | |
how to load image into array without using Cximage()... actually i need to process iage from array/buffer in visual c++ 2005. what are the steps to be followed to achieve tat... | |
Hi, I have a problem with reading the ْXML file,Can you help me . I need to extract the coordinates of points from the file and later use these points(U,V)to make a polygon . the U and V values are between two tags <contour> and <contour/> Thank you in advance | |
I am trying to get a random number without repeating. [CODE]int r,number; srand(time(NULL)); number=10; r=rand() % number+1;[/CODE] | |
Hi everyone, I'm writing a program for a teacher and friend of mine. It's a simple math-aid prog aimed at children up to 10yo. I was thinking that it would not only be a good idea that a child couldn't shut down the program without a password (obviously), but how … | |
Hello, I am getting very strange behavior on an STL set::insert() . [CODE] ... //Rebuild the P_set P_set.clear();//destroy old P set (shallow only) assert( P_set.empty() ); for(int i = 0 ; i < N ; i++){ cout<<"addr="<< &(C_array[i])<<endl; pair<set<C*>::iterator,bool> p = P_set.insert( &(C_array[i]) ); assert( p.second && "FAILED TO INSERT" … | |
Hi, I have created a tsk scheduler using c++. i have also created a trigger for it. But when I am trying to save the trigger by calling pIPersistFile->Save(NULL, TRUE) method it is throwing an error. The error is: unable to establish existance of the account specified task scheduler How … | |
i keep getting an error when i try to pass the array through function. Help? #include <iostream> #include <fstream> #include <string> #include <iomanip> using namespace std; void input(double carSpeed[6][7]); int main (void) { double carSpeed[6][7]; input(carSpeed[][]); return 0; } void input(double carSpeed[][7]) { ifstream FileName; FileName.open("noise.txt"); for(int x=0; x<6; x++) … | |
[COLOR="Red"]I'm calling sortprint but how can I Implement it? I also want to implement a the sort function. [/COLOR] [COLOR="Green"] I highlighted some of the things in red.[/COLOR] [CODE]#include <iostream> #include <vector> using namespace std; void sortPrint( const vector<int>& v); int main() { vector<int> v; vector<int>::iterator iter; int num; cout … | |
I will arrange my output in well-alligned columns, but I don't think I should use 3D char arrays since my teacher just wants us to stick with what we've learned so far. Check out my code. I'm happy about it, but I just can't get the alignment right. [CODE]//File: lab9.cpp … | |
Hello friends, I'm looking for an short example to read a text file and get lines splitting in 3 vectors. I don't know how I'll do this ... E.G: 100 NAME1 30 150 NAME2 40 200 NAME3 50 -> vectorId[0] = 100 vectorName[0] = NAME1 vectorAge[0] = 30 Can you … |
The End.