49,761 Topics

Member Avatar for
Member Avatar for hazzo

My Program : [code]#include <iostream> #include <string> using namespace std; void Reverse(string &InputString); void CharSwap(char& First, char& Second); void main(void) { string InputString; cout << "Please enter the string to reverse ==> "; getline(cin, InputString); cout << endl << "You entered the (" << InputString.length() << ") char long string: …

Member Avatar for vegaseat
0
125
Member Avatar for indianscorpion2

hi i am a student of computer science.i am learning the c programming language.we spend all our time writing programs which tells itself a secret like adding numbers,kid stuff etc. i want to know the real thing.can anyone tell me what are the real time applications of C.?

Member Avatar for letmec
0
180
Member Avatar for JoBe

Hello ladies and gents, Ive got a question concerning how to actually send a program to someone (only the exe.file) so that he/she sees what the program can do without having the possibility to alter anything towards the code itself? I'm using Microsoft Visual C++ 6.0 incase you need to …

Member Avatar for winbatch
0
115
Member Avatar for Prahaai

Anyone knows what are percents... Some event has some chances to happen. From 0 to 100... if the percent is 0 it means zero chances to happen. 100 means it will happen every time. 50 statistically means it will happen half of times... But HOW can someone give x/100 chances …

Member Avatar for Dave Sinkula
0
266
Member Avatar for edelstahl

So here's a pretty basic question. How do I access a file using C++? I want to be able to have the text file typed into the window of the program. I want to be able to write a string variable to a file, too. And another question, maybe not …

Member Avatar for Dogtree
0
1K
Member Avatar for madt

I have the following assignment due: Design a class -say, fraction - that performs the arithmetic and relational operations on fractions. Overload the arithmetic and relational operators so that the appropriate symbols can be used to perform the operation. Also, overload the stream insertion and stream extraction operators for easy …

Member Avatar for Dave Sinkula
0
271
Member Avatar for winbatch

The following works on solaris, but doesn't compile on windows visual studio 6. is there a way to do this differently so it compiles in both places? In ComandLineArg.h ------------------------- class CommandLineArg { private: ..etc.. static int longestDescr; ..etc.. }; In CommandLineArg.cpp ------------------------------- CommandLineArg::longestDescr=0; Error on visual studio: error C2501: …

Member Avatar for winbatch
0
687
Member Avatar for Kus

Hi, im pretty new to c++ and i have created the program below, and for some reason it sets 1 or 2 arrays right then the rest just 0's, when it uses the same code, and the data is getting threw to the calls etc... i have no idea why …

Member Avatar for Kus
0
314
Member Avatar for letmec

hello guys, I am making a browser for Dos (working in graphics mode) in c++. the problem is that i don't now how to get all the directories, file names in current drive (so that i can display their different icons). Kindly give me an example to get all the …

Member Avatar for Dave Sinkula
0
88
Member Avatar for davejigsaw

I am having trouble undestanding this code, can someone please help. I dont understand what the for loops do also. [code] void Merge( long array[], long left, long middle, long right ) { long i, j; long temp[MAX_ARRAY_SIZE]; for( i = middle + 1; i > left; i-- ) temp[i …

Member Avatar for Ghost
0
129
Member Avatar for missdiva
Member Avatar for Prahaai

Related to my game again, i want to choose my options by typing the command. Yet, i am in a big difficulty, because switch() only accepts numbers, or it accepts one letter. Everyone knows how switch works, i dont think i need to give an example. Anyway, i will post …

Member Avatar for Dogtree
0
172
Member Avatar for sinB

Hi! I use Turbo c++ 3.0, and i have been trying to write to video memory directly (0xB8 :eek: :eek: ). It works Okay in asm, how do i do it in c? (and i can't use inline asm for some stupid reason).

Member Avatar for Dave Sinkula
0
68
Member Avatar for usausa

I am trying to search for files in Directories. like, i have 10 directories..... and consider directory 1, which has 2 files.. this is same with all the files... i want to get a string from each of these files from 10 directories... to be written to a seperate file, …

Member Avatar for vegaseat
0
457
Member Avatar for Prahaai

I have this game skeleton. Now, as you can see, it is working, but when i choose something first time, i have to type it TWICE to make it work. It doesn't matter if i choose Status, Score, or Battle, or Flee, the result is the same: i have to …

Member Avatar for Prahaai
0
174
Member Avatar for riturajraina

Hi Friends, Can anyone tell how to change the attributes of a directory through C or C++. I have tried to found in my compiler's help file but it was showing the method to change the file attributes but not the directory's. I want to change the attributes of a …

Member Avatar for boggsi
0
432
Member Avatar for t3bruce

Can anyone suggest books that can help a first time C++ student. ;)

Member Avatar for t3bruce
0
159
Member Avatar for silkfire

I'm developing a small database application that can add records to a file, but also modify them in a few ways. It keeps the records in a temporary object of my class PersonInfo. The problem now is that it doesn't want to display things correctly, it seems to only be …

Member Avatar for silkfire
0
173
Member Avatar for Prahaai

/*I used and modified a piece of code i found in here and my main(){} looks like this:*/ [code]int main() { HANDLE hConsole; char welcome_l1[100]; char welcome_l2[100]; char welcome_l3[100]; char welcome_l4[100]; unsigned short k=120; hConsole = GetStdHandle(STD_OUTPUT_HANDLE); ifstream file("ver"); file.getline(welcome_l1, 100); file.getline(welcome_l2, 100); file.getline(welcome_l3, 100); file.getline(welcome_l4, 100); SetConsoleTextAttribute(hConsole, k); cout<<welcome_l1 …

Member Avatar for Dave Sinkula
0
215
Member Avatar for Tetsu

I'm running into to this problem where the fstream is suppose to read data off a file to store in arrays. I cant continue with my project until the program reads it right. It is skipping some of the datas. Can I get a little help? Thanks in advance [CODE] …

Member Avatar for Tetsu
0
470
Member Avatar for kisseric

Hi Folks, I am new to Daniweb and new to C++. I will appreciate any help I can get.

Member Avatar for kc0arf
0
82
Member Avatar for MitchellH

Hi, I am just a beginner at windows programming, so I am wondering, how do I create a dialog-based application (similar to that of using VC++ and MFC) with just the pure windows API? Currently I am just doing the following, but I have a slight feeling in my gut …

Member Avatar for Dogtree
0
148
Member Avatar for cspikes

I am a new c++ student trying to write code....please help..... I have a telephone entry Name has at most 40 charachters Seven digit number I want to be able to tell the number, name and reset name for name changes and reset the # if a person moves .

Member Avatar for Dogtree
0
131
Member Avatar for t3bruce

[code]using dice std; # include <cstdlib> int dice( ) { int. random_ interger = rand ( ) cout << random_ interger << end 1 }[/code]<< moderator edit: added [url=http://www.daniweb.com/techtalkforums/misc.php?do=bbcode#code][co[u][/u]de][/co[u][/u]de][/url] tags >> . Write the member function definitions for each function listed: 1. Object Type: a pair of dice Knows: The …

Member Avatar for Dave Sinkula
0
179
Member Avatar for t3bruce

Cplusplus question I need assistance with defining structures: 1. Write the member function definitions... Object Type: a pair of dice Knows: The vaule of each face (1-6) Can Do: ROll for new face values Tell the value on each face. Initialize the die to have a value of 1 on …

Member Avatar for Dogtree
0
181
Member Avatar for hzuniga4

For some reason the code is not printing the error string in the output screen of the operating system. Go figure? This code is directly out of the book. [code]#include<iostream.h> #include<fstream.h> #include<stdio.h> #include<stdlib.h> #include<conio.h> ofstream fileout; ifstream filein; void main() { char file[20]; //you must type in filename and extension …

Member Avatar for Catweazle
0
123
Member Avatar for Funktar

omg i need help so bad. I've been working on a school project for what seems like an eternity and i'm close to deadline. Using FIFO's (i ahve to) to communicate between parent and child proc's. Right now I'm stuck on a read/write. fifomsg is a struct with int length …

Member Avatar for Dogtree
0
169
Member Avatar for silicon

Hi everyone, I am still having a few issues with my program. It definitely runs but it just seems to run poorly. I think my problem lies within the following 3 sections Quicksort, Partition, and Insertion I've written comments next to each line of code just to make sure that …

Member Avatar for Dogtree
0
127
Member Avatar for sinrtb

HAving trouble with my pointer arithmetic, any ideas appreciated My orgional code [code] Activity p[51]; for ( int i = 1; i <= n; ++i ) { // Read the activity records. pert >> p[i].i >> p[i].j >> p[i].pt >> p[i].prt >> p[i].ot; pert.getline(p[i].desc,21); [/code] converted but wrong [code] Activity …

Member Avatar for Dogtree
0
452
Member Avatar for JoBe

Good evening everyone, This next exercise, I have to do the following: Write a ClassTemplate for a linked list. Demonstrate it by using two linked lists. The datafield of the first type is int, the second one is double. What Ive got sofar is this: [code] #include <iostream> #include <vector> …

Member Avatar for Dogtree
0
221

The End.