49,761 Topics
| |
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: … | |
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.? | |
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 … | |
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 … | |
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 … | |
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 … | |
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: … | |
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 … | |
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 … | |
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 … | |
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 … | |
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). | |
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, … | |
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 … | |
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 … | |
| |
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 … | |
/*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 … | |
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] … | |
Hi Folks, I am new to Daniweb and new to C++. I will appreciate any help I can get. | |
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 … | |
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 . | |
[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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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> … |
The End.