49,761 Topics

Member Avatar for
Member Avatar for timhuynh

Hi everyone. This is my first post . I develop this program in C-Free 4.0 with <iostream> header... And it working [CODE] #include <iostream> #include <cstdlib> #include <iomanip> #include <ctime> using namespace std; int main () { int random_num; srand((unsigned)time(0)); bool assigned_players[32]; for (int i=0;i<32;i++) assigned_players[i] = false; int n=32; …

Member Avatar for chiwawa10
0
158
Member Avatar for J.Killa

I'm doing a code in which a user inputs a word and then I have to output the word backwards, but for some reason, the black screen disappears when I enter the word...here's my code: [CODE] #include <iostream> #include <string> using namespace std; int main() { string word,backwards; int numchars=0; …

Member Avatar for WaltP
0
223
Member Avatar for pinsickle

Does anyone know where I can find info on setting up dll files to be called by a program? I am about to start a project but I realized it would be helpful if the finished program could be ran without a compiler on every computer it is to be …

Member Avatar for pinsickle
0
78
Member Avatar for coding101

We've just started I/O streams and i need some help with my prjct. Here is the lab: "Write a program that gives and takes advice on program writing. The program starts by writing a piece of advice to the screen and asking the user to type a different piece of …

Member Avatar for WaltP
0
217
Member Avatar for jigglymig1

my code is supposed to read in a binary file and then save the input to a text file. when i cout << coach[i] i get the output and jibberish [CODE]#include <iostream> #include <string> #include <cctype> #include <fstream> #include <cstdlib> using namespace std; int main() { char coach[500]; int i=0; …

Member Avatar for WaltP
0
127
Member Avatar for heynow12

I built a program that is supposed to read in a data file that looks like this for example: 1 2 3 4 5 6 2 3 4 9 8 7 1 6 5 7 4 2 1 3 4 5 6 7 2 5 7 8 3 1 3 …

Member Avatar for jonsca
0
155
Member Avatar for J.Killa

So I'm somewhat new to programming and I have a assignment in which I have to verify if the numerator entered by the user is a decimal, instead of a integer. If it is, then I throw an exception...the thing is I don't really know how to do it because …

Member Avatar for chary8088
0
142
Member Avatar for swolll

This is seg faulting whenever I try to remove anything. I've been trying to fix it for hours, to no avail. Any ideas? [CODE]#ifndef BST_H_ #define BST_H_ #include <stdexcept> #include <iostream> #include "btnode.h" using namespace std; /* A class to represent a templated binary search tree. */ template <typename T> …

0
61
Member Avatar for techie929

Hi everyone, I have to create 16 separate files for 16 nodes and write something in it. Is there any way in which i do not have to separately create sixteen files. //// sompe part of code which i am using [CODE] file2.open("Node0.txt");//Node0.txt is the file of ofstream type { …

Member Avatar for WaltP
0
76
Member Avatar for yuriythebest

Right basic question - I downloaded these source files, however there is no visual studio project file (sln) - how do I compile these in visual studio? [url]http://img146.imageshack.us/img146/5796/sourceu.jpg[/url]

Member Avatar for noey699
0
80
Member Avatar for NitaB

Hey guys! I'm trying to write a recursive function to take a number in binary form and change it to decimal. As of now I am having the dumbest problem. I can't seem to take 2 to a variable power. This is probably something so basic but I'm drawing a …

Member Avatar for jonsca
0
135
Member Avatar for hasrule

Dear fellow programmers, I had tried and successfuly created JVM and used JNI from C++ executable. But when I change my C++ executable into a shared library (.so, in UNIX) like this [CODE] extern "C" int callFromFakeSID(char* name) { JNIEnv *env; JavaVM * jvm; env = UART_Display_Java::create_vm(&jvm); if (env == …

0
69
Member Avatar for deepugtm

Vista doesn't support full screen mode while operating Turbo C++,and its also doesn't support graphics(bgi) while operating it. Is here any idea to run Turbo C++ with graphics in vista?

Member Avatar for sangramanand
0
722
Member Avatar for xofth

I want to get only y and n from user to enter when user try to enter another it get the input again until user enter "y" or "n" i use this logic but its not working [CODE] do { cout<<"\n\n Enter Number: "; number=getche(); cout<<"\n Want to enter another:(y/n)"; …

Member Avatar for xofth
0
203
Member Avatar for angrycoder

I'm supposed to create a program that takes a input file and goes through it and outputs it into a index file and counts the number of times a word appeared. It is only supposed to do words that are 3 letters or longer and I can't figure out how …

Member Avatar for Lerner
0
157
Member Avatar for Drunk.scientist

I am getting an Error stating canot convert string to Char type code is as follows [code] /* Jonathan Thomas ITSE 2421 intro to object C++ begin sudo code: function takes in string variable called "verb" function uses string function verb.length to determine length of string assigns value to size …

Member Avatar for jonsca
0
206
Member Avatar for vmirz

My goal is to implement a sorting into a linked list. I have everything working thus far, but I'm a bit stumped as to how I need to change my insert function in order for an element to be placed in the appropriate location. Here's my code thus far: [CODE] …

Member Avatar for VernonDozier
0
142
Member Avatar for dls_20022002

IS THERE ANYONE OUT THERE THAT KNOWS HOW TO WRITE TO A FILE'S LINE, WITHOUT CHANGING OR DELETING ANY OF THE OTHER LINES FOR EXAMPLE IF A LINE SAYS Status: Show and i want it to change that line to Status: James plz help

Member Avatar for Lerner
0
79
Member Avatar for Jaxzen

My program is supposed to essentially be something like Wheel of Fortune. As long as the user guesses letters that aren't in the word, the program behaves properly. But, when the user inputs a letter that IS in the word, the program stops and doesn't continue at all. [code] #include …

Member Avatar for Lerner
0
172
Member Avatar for dadamson90

I am trying to write a program that has a .txt file. It includes 4 names, 4 pay rates and the hours they worked. I have to use the file and import the data and make a program that outputs each worker their pay rate, hours they worked and their …

Member Avatar for strmstn
0
78
Member Avatar for LevyDee

Im teaching myself the Win32 API, so im messing around learning functions and what not. So how do I change the text on the button if it is clicked? I cant figure it out. Thanks [code] #include <windows.h> LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); const int …

Member Avatar for LevyDee
0
106
Member Avatar for PDB1982

I had my code working properly, but once I added my last array, it goes through the compile and then errors out....and I'm not quite sure why.... [code] #include <iostream> #include <fstream> #include <cstdlib> #include <cmath> using namespace std; int main() { double num[100], sum, count, newnum[100]; int j,i; ifstream …

Member Avatar for PDB1982
0
81
Member Avatar for nats01282

Hi all im after a piece of code that allows the user to enter a fraction e.g 1/4 and have the code split that fraction into 2 seperate variables, e.g variable 1 containing the '1' variable 2 cantaining the '4' How would i achive this? My objective is to make …

Member Avatar for nats01282
0
165
Member Avatar for soroush68

There's a simple question? how to print the size of a variable without using functions like sizeof() ? for example if you were asked to write a program that prints size of int without using sizeof() with a resault as below: cout<<sizeof(int);

Member Avatar for bharath404
0
255
Member Avatar for sdgz747

I am trying to read a file into an array and set the min and max values. At this point in my program, I am trying to just read it into an array and then display that array. I still have more to do in the program, but I am …

Member Avatar for WaltP
0
107
Member Avatar for corby

Ok so this is my code below in my member function definition .cpp file. The problem is when I execute the program it will not let me fill the answer for the first question so for example the output is: Please enter the name of the receiver: Please enter the …

Member Avatar for corby
0
105
Member Avatar for gregarion

Hey guys for my assignment i have to write a program which checks the information inside a text file to make sure it is all integers and then convert the integers to roman Numerals. My program seems to have a bit of a problem and im not sure where exactly …

Member Avatar for r.stiltskin
0
248
Member Avatar for Q8iEnG

Hi mates :) recently I did this code: [CODE]#include <iostream> #include <windows.h> #include <string> using namespace std; int main() { int check = 1; string dir; string dir2; string name; cout << "Which directory is the file located?\n"; getline(cin, dir); cout << "\nWhere you wanna move it to which directory?\n"; …

Member Avatar for WaltP
0
159
Member Avatar for mithunp

Trying to write strcat function, kindly review the code and post the comments.[code]char* mystrcat(char* dest,const char* src) { char* ptr; ptr = dest; while(*dest++ != NULL); dest--; while(*dest++ = *src++); return ptr; }[/code]

Member Avatar for Ancient Dragon
0
100
Member Avatar for sandorlev

hello! i've just tried out lists in c++, but they're giving me some kind of problem. it has something to do with iterators but i'm pretty sure i'm using them the right way. anyway, here is the code: [CODE] #include <list> #include <iostream> int main(int argc, char* argv[]) { std::list<int* …

Member Avatar for sandorlev
0
153

The End.