49,757 Topics

Member Avatar for
Member Avatar for godsgift2dagame

Hey guys, I was wondering how I'd go about returning a "list" of strings inside a member function. I'm assuming an array would have to be created, but I'm not sure...I've tried looking it up but anything with "string" Google'd leads to the string class. Please, I'd really prefer not …

Member Avatar for jonsca
0
161
Member Avatar for lotrsimp12345

i get a stack error [CODE] template <class KT, class DT> void my_bst<KT,DT>::show_bst_structure() const { my_bst_node<KT,DT>* b=root; show_bst_structure(b,0); } template <class KT, class DT> void my_bst<KT,DT>::show_bst_structure(my_bst_node<KT,DT>*& p, int level) const { int i; if ( root == NULL ) { for ( i = 0; i < level; i++ ) …

Member Avatar for lotrsimp12345
0
90
Member Avatar for GadiK

Hi. I'm writing a function for a project that has many authors. I thought it would be nice if there was a tool (VS add-in) that would enable me to insert a comment in the form of a flow chart so that I wouldn't have to write a lot of …

Member Avatar for GadiK
0
96
Member Avatar for yoshi14

I am halfway through writing a program to calculate training times, and best exp to health ratios for any game which I can use it in but i have run into an error. I am having a problem loading a form from when a menustrip item is clicked in Visual …

Member Avatar for yoshi14
0
138
Member Avatar for lotrsimp12345

Here's what I have so far [CODE] template <class KT, class DT> void my_bst<KT,DT>::show_bst_structure(my_bst_node<KT,DT>*& p) const { my_bst_node<KT,DT>* le=NULL; my_bst_node<KT,DT>* ri=NULL; //empty tree if(p==NULL) { cout<<"tree is empty\n"; } else { //print node key cout<<p->data<<endl; if(p->left!=NULL&&p->right!=NULL) { show_bst_structure(p->left); } else if(p->left!=NULL) { cout<<"enter left\n"; le=p->left; show_bst_structure(le); } else if(p->right!=NULL) { …

Member Avatar for lotrsimp12345
0
99
Member Avatar for punchinello

1. What's hard-coding? 2. What is a standards-conforming implementation? 3. What's "hand-written code"? 4. what's "objects created on the free store"? 5. I tried the escape character '\a' in my c++ program code, but no sound was emitted. Could anybody please tell me why? Thank you very much in advance!!:)

Member Avatar for jasonline
0
78
Member Avatar for xonxon

[code] The following code lists the nodes in a binary tree in two different orders: preorder:C,B,A,E,D,F,H postorder:A,B,D,H,F,E,C Draw the binary tree. The answer is : C / \ B E / / \ A D F / H so, my question is how should i think or is there any …

Member Avatar for mrnutty
0
139
Member Avatar for rrvs331

So I made this coin flipping program. It generates a random number between 1 and 2, and checks to see how many "flips" it would take for it to get 15 flips in a row. However, every time I run it, I get the same number, 13505, every single time! …

Member Avatar for rrvs331
0
228
Member Avatar for nychick

I have to write a palindrome test function, I'm thinking of creating two arrays. One is inserted by the user which then populates the second array in reverse. Is this the right direction to go? Thx

Member Avatar for mrnutty
0
92
Member Avatar for Dom83

Hey, I have been struggling with a problem on a project Im working on. I have 3 ints, day, month, year and I want to put them into a string I use for another function to search through a file. so lets say day = 20 month = 11 year …

Member Avatar for Dom83
0
105
Member Avatar for BobRoss

Sorry, the thread title should read "File paths with spaces" Hello everyone. I am finalizing this little shift cipher program that reads a plain text file line by line, encrypts it, and writes it to a cipher text file. I'm just having difficulty when a user enters file paths with …

Member Avatar for jonsca
0
109
Member Avatar for asweetroxxi

hello I wrote this code and i'm having some trubble with it. When i debugg my code i get a bunch of these errors. [TEX]c:\users\roxxi\documents\visual studio 2010\projects\lab3\main.cpp(33): error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'void' (or there is no acceptable conversion) 1> …

Member Avatar for jonsca
0
204
Member Avatar for Tales

How can I initialise a Datetime^ variable with current Date? I have this idea but I'm not sure: [ICODE] Datetime^ curDate = gcnew DateTime::Now; [/ICODE] Anyone?

Member Avatar for Tales
0
158
Member Avatar for complexcodes

Hi guys! I am wondering how can one perform a sorted merge between the calling object list and the the passed in list? Here is what I have got so far : [CODE]#include<iostream> using namespace std; #define NULL 0 template <typename T> class DoublyLinkedList; template <typename T> class Node { …

0
68
Member Avatar for PDB1982

I have my coding idea laid out, but I think there is an easier way, plus I can't really get it to work, because I don't know how to accommodate for duplicated values. Here is my data: [code] Enter name of file students StudentID LastName FirstName Q1 Q2 Q3 Mid …

Member Avatar for jonsca
0
116
Member Avatar for wh33lz

So here is the question and it is really stumping me because I can print the alphabet once but cant figure out how to repeat it. First create a character array that contains the 26 letters as shown here. //Easy I can copy and paste ha. [CODE]char cAlphabet[] = {'a','b','c','d','e','f', …

Member Avatar for evilctofwoc
0
6K
Member Avatar for lotrsimp12345

here is my code main [CODE] #include <iostream> #include "account.h" using namespace std; int main() { account a; return 0; } [/CODE] account.h [CODE] #include <iostream> #include "Lentext.h" #include "Deltext.h" #include <string> using namespace std; class account { private: char account_Number[11]; char name[1000]; char address[1000]; char city[16]; char state[3]; char …

Member Avatar for lotrsimp12345
0
135
Member Avatar for xcorpionxting

I am building a program requiring making some classes with inheritance. I can't seem to be able to access the members of the class objects. My code looks like this: [CODE]#include <iostream.h> #include <stdlib.h> #include <time.h> class Animal{ public: int number; int legs; Animal(){ number = rand()%9; } }; class …

Member Avatar for xcorpionxting
0
175
Member Avatar for qk00001

i.e char fullname[80]; char * prt; [U]in MySQL we can write : select * from table1 where name='fullname'[/U] How to write in C++? while(fullname!=NULL) { executeQuery"select * from table1 where name='"+fullname+"'" }//----I tried this, but dont work. need your help please。。。。。

0
62
Member Avatar for gogo000

how do i chck that a string contains integers or characters or is empty???

Member Avatar for mrnutty
0
94
Member Avatar for mariusmssj

want to be able to count the words in an array or a string :S but i am not sure how to do it could i get some help please what i want to do is be able to tell how many words have been entered. so i will need …

Member Avatar for mrnutty
0
169
Member Avatar for NinjaLink

hey, i wrote a program to create a hash table using an array of numbers, but I do not know how to display the actual table on my screen. Does anyone know how to display my results? So far, I am able to print the numbers that I have in …

Member Avatar for jonsca
0
130
Member Avatar for NinjaLink

I am writing program segments (not real programs or functions) to make sure if I understand how to do each one by using "push/pops for stacks" and "addQueue and DeleteQueue for Queues". Can someone please help me with these questions. I don't know if I am correct or not! 1. …

0
66
Member Avatar for PopnFresh

I'm using Visual Studio 6.0 for C++ and while I'm stepping through my code in Debug mode, I'm not able to view any of my static variables in the "Locals" section of the context window. I know there has to be a way to set this up, as the computers …

Member Avatar for mesmer
0
2K
Member Avatar for fabfour

hello guys and girls, as it's going to be quite obvious i'm not going to lie to you, this is coursework - however i really struggle with the programming aspect of my course and although repeatedly reading chapters in savitch's c++ guide and trying to understand my teacher i'm finding …

Member Avatar for mrnutty
1
135
Member Avatar for Towely

I'm having a few issues with my Pig Latin program. First, The program doesn't loop correctly. I need it to keep prompting the user for input until the user presses CTRL+D, but I can't figure out how. Right now, it never re-writes the line "Enter some text (CTRL-D to end):". …

Member Avatar for Towely
0
173
Member Avatar for merse

String is an object, but it can be initialize without (), like [CODE]string str;[/CODE] However if I define a user defined object, I must initialize it like: [CODE]myclass myobj(); [/CODE] How is it possibel to not use: () ?

Member Avatar for mrnutty
0
98
Member Avatar for calypso&noname

This question has largely already been posted, and I apologize for that. However, I cannot get the max an min values to change from anything except -1. I'd love to make them actually work; I feel like the comparison statements are correct. I know the counter is working properly, and …

Member Avatar for calypso&noname
0
122
Member Avatar for Mclovin1234

An integer is said to be prime, if it is divisible by only 1 and itself. For example, 2,3,5 and 7 are prime, but 4,6,8 and 9 are not. Write a function that determines whether a number is prime. Use this function in a program that determines and prints all …

Member Avatar for mrnutty
0
93
Member Avatar for Dex02

Hello guys, i need help. I just began to learn c++, and i have a problem. How to write a program, which count numbers in a interval from k to n. I now the program is simple but i just can t bring it to work. Im using the loop …

Member Avatar for Dex02
0
110

The End.