51,592 Topics
![]() | |
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 … | |
I'm trying to create an overload of the "+" within my program to add a private constant value to an already establish polynomial, but the last portion of my code comes out with the following error: [code] Error 1 error C2677: binary '+=' : no global operator found which takes … | |
This is just out of curiosity! Does anyone know what is the maximum number of characters that a line of code can have? EDIT: Added more details. Is it possibly possible to make two lines become one? .... This seems pretty odd, I dont know how to explain it, but … | |
Hey guys, Im trying to make a program that guesses the name of an animal in the users head by asking him or her a bunch of questions. The questions, answers, and line number for yes/no are inlcuded in the file animals.txt as follows: Q Does it have feathers? 2 … | |
[CODE]# include <stdio.h> int abc(int & x) { return x; } int main() { int y = 0; abc (y++); // error here return 0; }[/CODE] error is error C2664: 'abc' : cannot convert parameter 1 from 'int' to 'int &' But if i call the same function as abc … | |
okay i need some help with this...i'm creating a graph program..the problem is the linked has to be user specified...i manage to create a linked list..i don't know how to create another one...its some sort like this : 0 1 2 0 - - > created this 1 - - … | |
Hi guys, Design question: I have a class that contains 2 vectors, and I'd like for that class to provide a public interface to access the next element in either list. The easy way to do it is to obviously return the list itself, either const or not, but this … | |
I am trying to understand one C++ program, which has a loop written as follows: [CODE] for(int i = 0; i < (1<<m); ++i) { for(int k = 0; k < m; ++k) { if(i&(1<<k)) { //in subset } } } [/CODE] I do not understand how the loop control … | |
ok so if i have somthing like [CODE]#include <iostream> using namespace std; int main(){ int action; cout << "have this show up first" << endl; cout << "then have an if statement here" << endl; cin >> action; if (action == 1){ cout << "then have this show up but … | |
I'm having some trouble finding a place to put this question, since I don't have any insight in coding. Please let me know if the thread is misplaced, and I'll move it. Question: I have an idea of an app for iPhone/any smart phone and before I move on with … | |
hey i need help with writing a program where it lets a maker of chips and salsa keep track of sales...i have this so far but dont know what else to do. [CODE]# include <iostream> # include <iomanip> using namespace std; int getTotal (int [], int); int posOfLargest (int [], … | |
My code converts roman numerals to the number values but i dont know how to make it do deciamls too, like for example: XX-X. I need it to recognize the "-" and start the loop again. How do i do that? Here is the code: [CODE]#include <iostream> #include <string> using … | |
Hello everyone: I am a C++ newbie. I have used Matlab to fill the rows or columns of a matrix with values from a vector and I'm wondering how to do the same thing in C++... I have written code that puts new values in a vector. This happens in … | |
Hi, I installed VC++ with SQL Server 2008, but I cant find SQL Server Management Studio application. Can you talk me why? Installation of all components was good and I can find other components. | |
Hello Every one, I am having trouble finding my correct condition to not run off the end of my file. So i am reading from a file and then tokenizing my data accordingly. My file has 16 lines and using my size function i get 18 lines instead since i … | |
[CODE]include <cstdlib> #include <iostream> #include <iomanip> #include <stdlib.h> using namespace std; void printintromessage (); void getUserInput (char& Y); int main(int argc, char *argv[]) { const int numofgamesinseries = 3; const int numofplayersonteam = 4; int i, score[numofgamesinseries]; int j, players[numofplayersonteam]; char Y = Y; printintromessage (); getUserInput (Y); do { … | |
I have been having various issues trying to figure out a very trivial problem. I've re-written this code now several times and used many different condition statements etc... One issue that i'm having right now is the input for the variable "paragraph" not being available, the paragraph input is skipped … | |
Hello everyone, I have a problem and almost found a solution, for example this: [url]http://www.parashift.com/c++-faq-lite/multiple-inheritance.html[/url]. However in my case I cannot solve it in a proposed way and will explain it shortly why... So basically, I have a BaseView, that derives from QWidget like this: [code=c] class BaseView: public QWidget … | |
hi everybody, i would like to know how to computes and returns d2 – d1 d2 is passed to the function by reference and d1 is the implied calling object; date d1 is earlier than date d2 the function returns the difference between two date objects in terms of number … | |
I'm programming my own game at the moment, its connecting to a server and the server sends some spawn info and eventual other players who are connected. When a player moves, and an other player is also connected, the client of Player2 crashes. I don't know what is causing this, … | |
Hi. I know it's now rly allowed to post homework and stuff. But i just need some help, like hints, or examples. =] Don't fully understand how arrays(marked as mass in prog.) work yet. Arrays = massivs (in the countries language where i live) [ The point is to have … | |
Example: [CODE] class foo { public: void DoNothing() { cfee.AddNothing(); } }; class fee { public: void AddNothing() { int a = 0; a += 1; } }cfee;[/CODE] Is there a way to call a function in a instance of a class that was declared after the creation of the … | |
Hi Everyone, I'm really fed up of working on C in Windows Vista. First and foremost, the window of C occupies only half the screen which is very annoying. I've heard that there is a distinct C that is used with Vista but I have failed to attain any more … |
The End.