48,986 Topics
| |
I have no idea how C++ works, but I'd like to learn... Is it possible to create java files/programs using C++? | |
What is the greatest possible range of rand()? I want to make it that of a long signed integer, but my program crashes. Is there another way to get that range? | |
Hello, everybody! I'm writing a code, which should be able to insert a node to a binary tree where specified. Commands are being loaded from a .txt file. The contents of the .txt file are the following: 1 L 1 2 R 1 3 L 2 6 R 2 4 … | |
I am trying to write a program that dynamically increase the size of an array. essentially creating an array inside of an array with array [b]a[/b] storing 100 int pointers. my code is initially having problems on line [code] a[count] = new int [n]; [/code] any tips or pointers as … | |
Hi! I saw a post on this site that exhibited the same exact problem that I have for a homework assignment and while it was solved, my issue with the homework assignment is different. The C++ program that I wrote asked the user to input information but once you enter … | |
Hello everyone, I've used this website many times to help myself based off of others' questions, but now I have a problem of my own that I can not solve. I was assigned the task of creating a stack program in C++ using a linked list. Seems simple enough, but … | |
I'm making a student database using array based lists. I'm having trouble with making the list size created by the user. I have a for loop there now but once I put it there, I get an error saying aStudent is an undeclared variable and I don't understand why. There … | |
Hi! guys i am a beginner and jus wanna know Using if else or switch operators i need to know the c++ code for writing a program that accepts a character and determines whether the character is lowercase letter | |
Hi every body I have about while loops and I just answered Q: a & b plz help me [QUOTE] **Write a program that user while loops to perform the following steps: a)Prompt the user to input two integers: firstNum and secondNum. (firstNum must be less than secondNum.) . b)Output … | |
I'm trying to write a progam that; Contains a function called sumN() which takes an int n as an argument and returns an int which is the sum of all integers between 1 and n. In the main() asks the user: How many values (s)he wants to enter (maximum 50); … | |
I am having trouble printing the contents of a b-tree of order 'n' in level order. I have looked at algorithms online, but they only cover trees that have nodes with only 2 children. Shouldn't it also be called recursively? No algorithm I found used recursion. [CODE]void addToQue(struct node *root) … | |
i neeeeeeeeeeeeeed help please Create code that: * stores the x and y coordinates of the mouse into two arrays x[] and y[]; * the size of x and y should be 50; * the latest coordinates (from mouseX and mouseY) should be stored in position number 0 of the … | |
So i have to create a program which reads the number of days in the month and the temperatures. This info is in other file, temp.dat. I have how to calculate the average temperatures, but am having trouble reading from the file. Also, for every day that is in a … | |
I'm having problems trying to implement a counting sort for a template linked list. I already coded everything and I get the correct output. Now I just need to sort using counting sort method. When I run the project, the program crashes and it says: First-chance exception at 0x00262805 in … | |
char* ...is it similar to char var[5]; int *x; x = & var[0]; ? | |
Hi, I have a complex C++ code with gui. Each major gui division is independent class. Now these classes must 'talk' sometimes in operations like copy from division A and paste in division B. So I need to pass some pointers from one class to another. I was thinking of … | |
I am aware that this is something that has been asked repeatedly, and that conio is outdated, it is completely non-standard, but I need do use BGI graphics(in Turbo C++ 3) for my school project and for that along with BGI I need conio too.. I convinced my teacher to … | |
Hi all, I need to have a program to word count remove punctuation and sort it in alphabetical order. I had done the word count portion but i am lost in removing punctuation and sorting in alphabetical order portion. Hoping to get some help. [code] #include <fstream> #include <iterator> #include … | |
First I'd like to say how much I appreciate these forums. They have helped me before, but this is the first time I've posted a question myself. My problem is that I use a different IDE than my teacher does (probably not the best idea) so I want the program … | |
Why won't this output my string vertically? THanks in advanced, bookmark. [CODE]#include <iostream> #include <string> using namespace std; void print (const string & s); void main(){ print("blah"); system("pause"); } void print ( const string & s){ int i; int clrscr(); for(i=0;i<4;i++) { cout << "\n %c", s; } } v[/CODE] | |
I seem to be very bad with playing around with pointers. Basically the specialization template is supposed to return the address of the longest of the 5 strings provided. I keep getting an error on line 20 about char vs char *. Please some help, a good explanation on the … | |
I am having a similar issue [CODE]// Exc_3.cpp - Testing string with refernece #include <iostream> #include <cctype> #include <string> #include <cstring> using namespace std; string lowerToUpper(string & ref); int main() { string str; string constant = "q"; cout << "Enter a string (q to quit): "; //while (constant != getline(cin, … | |
This is my first group project me and one other person wrote the majority of this program. I put message on the functions and other things i need help on. It seems to work a little bit but I'm not getting the correct values when I try to run this … | |
i currently am throwing an exception in my constructor of my class and i read that when u do such a thing, the objects destructor is never called! meaning if i allocate any memory without using the heap, i have to MANUALLY deallocate the memory myself. An article i read … | |
Hi all, I have a silly question regarding how to translate this command in CMakeLists.txt g++ x04.cc -o demo -lplplotcxxd x04.cc is c++ file , information about lplplotcxxd can be found here [url]http://ubuntuforums.org/showthread.php?p=8538977[/url] since the command " g++ x04.cc -o demo -lplplotcxxd" is working on my computer so I think … | |
[CODE] #import <iostream> #import <string> #include <fstream> using namespace std; //The phonebook itself. class Book { public: int people; //The information for a person. class Person { public: string firstname, lastname, phonenumber; }; //Returns 1 if Person1 comes before Person2, 2 if Person2 comes before Person1, and -1 if they … | |
Hi, this is my first time posting and I would like thank everyone in advance. I'm doing a homework assignment that requires me to design a teller application which simulates a bank. I'm currently getting a segment fault, after I call one of my getBranch(). I've tried to do this … | |
I've finished a void display function for an in-game menu. I'm trying to have the menu stay at the top of the cmd for the length of the game. However, since it's a separate function, the program stays in the menu function, and never reaches the functions that follow it. … | |
| I have been tearing my hair out over this, and I have written and rewritten the code over and over again. If I can get some kind of direction or where to start, it would be awesome! I put something down there that I have tried for one of the … |
Hi all. I am having trouble with my code. I have played around with it for a while, and I just can't seem to get it. The only thing I am having trouble with is it getting to output the a.m. and the p.m. correctly. [B]it always outputs p.m. no … |
The End.