49,761 Topics
| |
Hey guys! I must have some sort of logic problem that I'm just not seeing. I just want to read a file into a 2D array. The dimensions of the array are given by the very first line of the input file. Everything works hunky dorey except that when I … | |
Hi everyone, I'm sure I'm doing something silly here! Basically my constructor creates a pointer initialised to null, then in one of my functions I create an integer array on the heap using the new keyword. Now basically I have a data structure that needs to be copied, like so … | |
The assignment was to write a program that generated a random sequence of six non-repeating numbers between 1 and 53 until it matched a user inputted sequence (lotto). Here is the entire program. [CODE=c] #include <stdio.h> #include <stdlib.h> #include <math.h> #include <cctype> #include <iostream> #include <windows.h> #include <time.h> using namespace … | |
Hi =) I'm a beginner with c + + so I have a small problem with Visual C + + When im typing } in vc + + it will not type } so I was wondering how do I fix this problem? | |
I read somewhere else and found some code that had something like this in it: [CODE]char buf[] = {0};[/CODE] what does this do? thanks mitch9654 | |
hey am doing an assignment i need your help cause i reached something and i can't solve i have to make these stuff that i did to inheritance and polymorphism. the assignment is about I am required to design an Advisory System which models the academic advisor and advisee system … | |
Hello, I am working on a merge sort but I keep getting the following error : ds07(6443) malloc: *** error for object 0x100100098: incorrect checksum for freed object - object was probably modified after being freed. I don't see what my error is with the creation and deletion of my … | |
It provides the average grade of an student. Assignment: How many students are in the class ? 3 Enter five test scores for student number 1 80 90 70 90 80 The average for student number 1 is 85 Enter five test scores for student number 2 100 60 60 … | |
Hi. I need some help with some code i'm writing. I'm new to c++ and to be honest i feel like i have tried everything but cant get this bit working. I've included the small part of the program i have so far. I still have a lot to do … | |
Hey guys, I have been trying to do some stuff outside of my class to learn a bit more and I have come across something called a vector. And I read online that its similar to an array! But I am not sure how to do this. I have been … | |
Hello, I have Visual C++ 2008 in a Windows 7. I wanna get the value from a textbox to an int, after that I wanna make some operations with the int like + or - or * or / and I want to write it to an another textbox. And … | |
I'm trying to write a program that builds a full binary tree from an array containing an even number of sequential numbers. I know the memory allocation part, I'm just having trouble with how to pass the integers to act as array positions. This is what I've come up with … | |
Hello, I wanna create a string witch gets the value of a textbox. How can I make it ? THX for your replays :D | |
Suppose I had a network of switches, or more generally, Nodes. Each Node has a method getNeighbors(), which returns a set of adjacent Nodes in the network. Write a function findNeighborhood(Node, n) which given a Node and int n returns all nodes no more than n hops away... I want … | |
So I finally decided to take on some Windows Programming, and everything is going fine, except this: Edit: using this tutorial [url]http://bobobobo.wordpress.com/2008/01/31/how-to-create-a-basic-window-in-c/[/url] [code] #include <windows.h> int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { WNDCLASS myWindow; myWindow.cbClsExtra = 0; myWindow.cbWndExtra = 0; myWindow.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); myWindow.hCursor = LoadCursor(NULL, … | |
Whenever i type in code, Visual Studio puts an dot or a tab(->) in between code.I tried uninstalling and reinstalling Visual Studio, but that didn't do anything.I'm not quite sure what i did and i can't find a way to undo it. Thanks! P.s.-I tried to copy and paste the … | |
HI ALL. I'M LOOKING FOR A SOLUTION FOR MY CODE. I WANT TO FIND THE [B]HIGHEST CHARGE[/B] AFTER AN ARRAY HAS SHOWN UP(SPEAKER'S FEE). WHAT CAN I DO?? THANKS HERE'S MY CODE: [CODE]#include "stdafx.h" #include <iostream> #include <iomanip> using namespace std; struct Bureau { char name[50]; // Name char phoneNum[50]; … | |
so far I could manage to create OpenFileDialog and select the txt file. after that ,How could I display the contect of selected txt file into TextBox? [CODE] ************************************************************* private: virtual System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { System::Windows::Forms::DialogResult OK = openFileDialog1->ShowDialog(); } private: System::Void openFileDialog1_FileOk(System::Object^ sender, System::ComponentModel::CancelEventArgs^ e) { ???????????????????????????????? … | |
Why should a function that accepts an array as an argument and process that array,also accept an argument specifying the array's size? | |
How would I loop a switch statement until one of the valid options are entered. would this work? example: [code] // lets just say all the necessary starting code is already here.... int choice, number; do { cout<<"please enter a number from 1-3\n"; cin>>number; switch(number) { case 1: break; blah … | |
Hi everybody, I'm trying to develop an application for personal use, that will just make my life at work a lot easier and save me from doing a repetitive process by hand, when I know it could be done with [B][I]relative [/I][/B] ease in C++. Anyway, I want to be … | |
well so i've made a simple wrapper class to facilitate uploading a text file to my server.....and i can't seem to find the problem.....would anyone be kind enough to see where i did wrong? HTTPPost wrapper class: [CODE=c++]#ifndef _HTTP_POSTER_ #define _HTTP_POSTER_ #include <windows.h> #include <wininet.h> #include <tchar.h> #include <fstream> #include … | |
Hello Daniweb! I'm coding a small application and I've hit a road block. I've been using C++ for almost two years now, but to be honest, I hardly use dynamic polymorphism (i prefer static), and so with great embarrassment, I come here to ask this: My code is basically structured … | |
The following is an excerpt from a complete program that runs without any errors. It has 2 file dependencies which it uses to access and store information. The program, in its entirety, displays a menu with 4 options the user can choose from. [LIST=1] [*]View Characters [*]View Items [*]Add Character … | |
Hello, I am currently working on a project that requires me to write write a program that adds, subtracts, multiplies and evaluates polynomials. I am required to use linked lists of nodes. I am stuck on writing the code to input the polynomial. I understand how I will input each … | |
I know that this book is for C++ Primer 3rd Edition (Stanley Lippmann) but can this be used for C++ Primer 4th Edition. There is no C++ Primer answer book for the 4th Edition. Still comtemplating if i should get it. :?: | |
I am writing a program for class that inputs two of chars values no larger than 20. Then it adds these to Values together and prints the sum. Say this is my input Value one 123 Value two 456. This is how i input it into program for keyboard. 3 … | |
how repair the faild? [CODE] #include<iostream> using namespace std; #include<ctime> int rolldice(void) int main() { enum status {continuo,won,lost} int sum , mypoint; status gamestate; srand(tim(0)) sum=rolldice(); switch (sum) {case 7; case 11; gamestate=won; break; case 2; case 3; case 12; gamestate=lost; break; default; gamestate=continuo; mypoint=sum; cout<<"enter:"<<endl; break; while (gamestate==continuo){ sum=rolldice(); … | |
Well, I had my program running perfectly, and I was quite pleased with the results. However, after I made the text file a bit big, the program just stopped working all together. (255 lines of text) so I 'suppose' it is a bandwidth problem..however 255 lines of text is like … |
The End.