51,592 Topics

Member Avatar for
Member Avatar for ajsavoca

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 …

Member Avatar for ajsavoca
0
125
Member Avatar for B00t3r

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?

Member Avatar for strmstn
0
136
Member Avatar for mitch9654

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

Member Avatar for mitch9654
0
64
Member Avatar for modyutd

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 …

0
47
Member Avatar for pinsickle

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 …

Member Avatar for mitrmkar
0
83
Member Avatar for pinknblu

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 …

Member Avatar for pinknblu
0
186
Member Avatar for robski

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 …

Member Avatar for robski
0
92
Member Avatar for tarheelfan_08

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 …

Member Avatar for mitrmkar
0
383
Member Avatar for juuuh333

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 …

Member Avatar for juuuh333
0
3K
Member Avatar for jmoran19

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 …

Member Avatar for rydhima
0
147
Member Avatar for juuuh333

Hello, I wanna create a string witch gets the value of a textbox. How can I make it ? THX for your replays :D

Member Avatar for juuuh333
0
612
Member Avatar for greedydeepak
Member Avatar for karanjaswal

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 …

Member Avatar for WaltP
-2
53
Member Avatar for LevyDee

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, …

Member Avatar for nithy.sweety
0
521
Member Avatar for GooeyG

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 …

Member Avatar for GooeyG
0
87
Member Avatar for casjackkwok2001

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]; …

Member Avatar for WaltP
0
363
Member Avatar for fyp

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) { ???????????????????????????????? …

Member Avatar for fyp
0
653
Member Avatar for hurricane123

Why should a function that accepts an array as an argument and process that array,also accept an argument specifying the array's size?

Member Avatar for WaltP
0
63
Member Avatar for SCoder1

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 …

Member Avatar for WaltP
0
94
Member Avatar for f0rd

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 …

Member Avatar for WaltP
0
283
Member Avatar for dzruptz

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 …

Member Avatar for dzruptz
0
89
Member Avatar for athlon32

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 …

Member Avatar for jonsca
0
139
Member Avatar for tinkeydo

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 …

Member Avatar for tinkeydo
0
183
Member Avatar for sbdblyss

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 …

Member Avatar for Lerner
0
114
Member Avatar for yapkm01

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. :?:

Member Avatar for Spartan-S63
0
146
Member Avatar for Jeff_5_7

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 …

Member Avatar for Luckychap
0
97
Member Avatar for Roo0ond

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(); …

Member Avatar for jonsca
0
111
Member Avatar for restrictment

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 …

Member Avatar for david.k
0
176
Member Avatar for PDB1982

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 …

Member Avatar for david.k
0
178
Member Avatar for ccaatty

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 …

Member Avatar for cassandy
0
105
Member Avatar for som3aman

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 …

Member Avatar for Lerner
0
2K
Member Avatar for cpp.coder

[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 …

Member Avatar for cpp.coder
0
200
Member Avatar for gopi17

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 - - …

0
64
Member Avatar for Galf

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 …

Member Avatar for Galf
0
106
Member Avatar for nx86

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 …

Member Avatar for WaltP
0
113
Member Avatar for skorm909

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 …

Member Avatar for WaltP
0
173
Member Avatar for miss_kruse

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 …

Member Avatar for Talguy
0
116
Member Avatar for cowboyz209

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 [], …

Member Avatar for WaltP
0
154
Member Avatar for blind122

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 …

Member Avatar for WaltP
0
312
Member Avatar for Annettest

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 …

Member Avatar for Lerner
0
276
Member Avatar for 1manik

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.

0
49
Member Avatar for MonteM

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 …

Member Avatar for Fbody
0
140
Member Avatar for MTW1989

[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 { …

Member Avatar for MyrtleTurtle
0
262
Member Avatar for Jean88

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 …

Member Avatar for Jean88
0
583
Member Avatar for Krzysztow

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 …

Member Avatar for Krzysztow
0
86
Member Avatar for samanamuo

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 …

Member Avatar for Banfa
0
392
Member Avatar for Pynolathgeen

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, …

Member Avatar for Pynolathgeen
0
115
Member Avatar for Crow13

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 …

Member Avatar for Crow13
1
119
Member Avatar for VilePlecenta

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 …

Member Avatar for VilePlecenta
0
150
Member Avatar for Valdemar009

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 …

Member Avatar for jephthah
0
162

The End.