51,593 Topics

Member Avatar for
Member Avatar for Jennifer84

I have a wondering here. This code I have below is working great except of one thing that doesn´t make sense to me. I use a while-loop inside a for-loop as seen. The for-loop is counting from 1-49 and for each count the while-loop will read a .txt file and …

Member Avatar for Jennifer84
0
111
Member Avatar for curt1203

I once again am having trouble with this program. I really thought i understood this right off the bat but once i got into it, there is a lot of little technical things my professor wants in it. Like the functions and generating random numbers. Any help would be awesom, …

Member Avatar for curt1203
0
298
Member Avatar for cosmos22

Hello, I was wondering how you might go about detecting a drive letter, such as D for DVD drive, if you wern't to run it on your own computer. I have programmed something that picks a certain drive letter in an attempt to match it to theirs. The reason is, …

Member Avatar for cosmos22
0
148
Member Avatar for Alexandros

Can anyone please help how i can do the following program? If there is actually a similar program in C++ section can anyone post me it? I will appreciate it! [B]Task: Calculate 2 floating numbers choosing the option you want from the menu as follow: 1. Addition 2. Subtraction 2. …

Member Avatar for Narue
0
73
Member Avatar for conklin

program 1: #include <iostream> using namespace std; class person { char name[30]; int age; public: void getdata(void); void putdata(void); }; void person :: getdata(void) { cout << "Enter name"; cin >> name; cout << "Enter age"; cin >> age; } void person :: putdata(void) { cout << "\nName" << name; …

Member Avatar for conklin
0
107
Member Avatar for Jboy05

How do I go about writing a user-defined function named Get_Inputs that when called, the function will prompt for three integers and send these numbers to its calling environment.

Member Avatar for Jboy05
0
105
Member Avatar for d0ugg

Hello All, I'm creating a program that reads a file.dat and I need to input that in a matrix, it can be 2x2,3x3,4x4 or 5x5. I'm not exactly sure how to do that. The file.dat looks like this: 2 1 2 3 5 3 1 3 8 5 7 3 …

Member Avatar for d0ugg
0
247
Member Avatar for farag

If you know a certain c++ library treat with excel sheet with efficient way that can read acertain row or columns Support me by it

Member Avatar for abrou
0
115
Member Avatar for knewc

Hello, i made this code, it is giving me random numbers, but 1 too many, and a couple numbers out of the range..please help!!! [code] #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main (){ int x; //range number 1 int y; //range number 2 int m; //how …

Member Avatar for Dave Sinkula
0
93
Member Avatar for unclepauly

can someone please try and explain something to me... i have 2 functions, lets call them FuncA and FuncB. FuncA calls FuncB, and FuncB does some stuff then simply returns. both functinos are placed in try...catch statements: [CODE] void FuncA() { try { FuncB(); } catch { trace("FuncA caught exception …

Member Avatar for vijayan121
0
112
Member Avatar for jrivera

This is Homework. I have been working on a tournament program. Currently the tournament class gets user input and instantiates a player class and a game class. The game class then calls the board class where it instantiates a boardconfig class object. At this point Is where I get my …

Member Avatar for vijayan121
0
102
Member Avatar for cosmos22

I started a windows application, that used the void hide.. function to hide the command window. I compiled it, and it worked. Why is it, that if I compile the source file, and not the project file, it keeps the window open? Dispite the fact the coding is exactly the …

Member Avatar for VernonDozier
0
100
Member Avatar for knight fyre

I'm working c++ project but before I can start coding I am required to analyze the problem and determine potential objects/classes - Object Orientated Analysis. I read through the paper a few times and did my analysis. Tell me what you guys think. I'm not verse in this area so …

Member Avatar for VernonDozier
0
69
Member Avatar for tootypegs

hi, i am totally new to this and i would appreciate some advice or if you guys know any articles i could look at to research. I want to create a program that will copy the contents of RAM to another file. I have no idea where to start! It …

Member Avatar for gerard4143
0
84
Member Avatar for volscolts16

Ok, I am tryin to use the proper coded way that a few of you have asked, so don't yell if I screw up the first time, please. I was able to debug and run, but had many errors, I have fixed several already, biggest problems are that if I …

Member Avatar for Ancient Dragon
0
145
Member Avatar for cosmos22

Hello, I would like to pose a very simple question, does anyone know how to clear the command window of text, and give it a name(Eg. Cosmos's Program) I would like to make room for different lines of text in my program, and also give it a name, for obvious …

Member Avatar for cosmos22
0
149
Member Avatar for ankitbullu

What enables C to support variable function arguments (varargs), while other languages (like Java) do not support this feature? What is special in C which is not there in Java to support this?

Member Avatar for ankitbullu
0
89
Member Avatar for vs49688

Hi. I am trying to make a program that will launch restricted user-specified programs at my school. How would I make the system() function below make use of the two variables in it. I've tried && and ||, but the bugger wont work. [code] #define runasc "runas /profile /user:tsc\\staffuser" system( …

Member Avatar for Nick Evan
0
106
Member Avatar for campbm39

Hi, I am pretty new to C++ and would really appreciate some help. I'm trying to write a program that will click on a particular color pixel on my screen. For instance, the program would click on a blue dot on my desktop. I play a mmorpg and I have …

Member Avatar for codeaa
0
130
Member Avatar for Exo1337

So My input document has the following data 56 38 A 7 8 My program: #include <iostream> #include <fstream> using namespace std; int main() { ifstream inData; ofstream outData; int num1, num2, num3, num4; char ch1; inData.open("c:\\inDatat.txt"); outData.open("c:\\outData.txt"); inData >> num1 >> num2; outData << "Sum of " << num1 …

Member Avatar for vmanes
0
109
Member Avatar for Jennifer84

I am trying to use ifstream to read from a file. When you use ifstream you have to specify the path like this. [code] ifstream Symb("Folder1\\Folder2\\File1.txt"); [/code] Instead of specifying like that, I will find a variable Text from a comboBox like the code below. Path has the string: "Folder1\\Folder2\\File1.txt" …

Member Avatar for codeaa
0
839
Member Avatar for Jboy05

I need help fixing this I help getting errors #include <cstdlib> using namespace std; void show_word (string); int main () { show_word ("hello"); system ("PAUSE"); return 0; } void show_word (char); { char InName; cout << "Enter your name " << endl; cin >> InName >> endl; show_word ("hello"); show_word …

Member Avatar for Jboy05
0
111
Member Avatar for knewc

Hello! I was wondering how to generate random numbers within a given range X and Y using rand. Thanks!! I was thinking that it may be along the lines of [code] rand() & x+y [/code] however this does not work. Any help would be amazing! Thanks guys and gals!

Member Avatar for Dave Sinkula
0
55
Member Avatar for Exo1337

Soooo I essentially need to make a program to evaluate any exspression that is plugged in to it, how would I go about starting a program like that ? I know how to evaluate normal exspressions including + - * / but what if a user wants to do a …

Member Avatar for codeaa
0
2K
Member Avatar for Jennifer84

I am trying to get the text that is choosen in a comboBox. I have tried these codes but no of them are working. What am I doing wrong here ? [code] std::string Text; // I have tested all 4 of these and this will not compile. //I belevie it …

Member Avatar for Jennifer84
0
193
Member Avatar for Techboy1523

Write code to prompt the user to input a character and a number. Then print out the character that number of times. This is one of many questions I must answer, but it will help me get started on my code.

Member Avatar for totem mouse
0
81
Member Avatar for Jboy05

Consider the following user-defined function: [code]void Quick_Change (int x, int & y) { if (x == 0) y = 10; else if (y == 0) x = 10; } [/code] Assume the values in variable A and B are both of int type. How do I find what the values …

Member Avatar for Jboy05
0
97
Member Avatar for buffe

Hi, I'm a new one for c++. I want to call a function in time intervals. (as an example lets say for every 100ms ). How can I do that. Please help:S Thank you

Member Avatar for Nemoticchigga
0
114
Member Avatar for vesper967

no idea what to do about this error =/ [code]#include <stack> #include <string> #include <iostream> #include <fstream> using namespace std; int main () { stack<string> stack; ifstream inFile; string consoleStr = "Enter Filename>> "; string fileName; string word = ""; char c; cout << "Welcome! Enter filename or quit to …

Member Avatar for prushik
0
1K
Member Avatar for mrjoli021

I wrote a class in vs2008. I am creating a new project and I need to incoporate that class into it. How do I do that. I added the .h to the header section and the .cpp to the source file. In the new program i did #include "firstclass" but …

Member Avatar for Nemoticchigga
0
125
Member Avatar for micah1983

help with c++ problem. a software company sells a package that retails for $99 . Quantity discounts are given according to this table. Quantity Discount 10-19 20% 20-49 30% 50-99 40% 100 or more 50% Write a program that asks for the number of units sold and computes the total …

Member Avatar for carnage
0
599
Member Avatar for cbattagler

At this point I am trying to get data from a std::list or std::vector. I push_back the object from a pointer into the list and go on my merry way, I do this until I get to the point I want (which is working at the moment) but then when …

Member Avatar for cbattagler
0
106
Member Avatar for Jboy05

how do I wrtie a function that takes one argument of type double. The function returns the character value ‘P’ if its argument is positive and return ‘N’ if its argument is zero or negative. [code=c++] double Letter ( double P, double N) if (P = +); return P; else …

Member Avatar for kjc367
0
117
Member Avatar for Swati_bansal

When I try accesing private members of a class using friend functions after including the concept of templates in visual basic c++, the compiler shows me an error message that friend functions cannot access the private members declared in class. Please help.....

Member Avatar for farag
0
278
Member Avatar for Techboy1523

Write a program that will prompt the user to input the following: length and width of a rectangle , a character, and a choice for either filled or unfilled. If the choice is filled, print out a filled rectangle with the indicated length and width using the input character. If …

Member Avatar for kjc367
0
209
Member Avatar for farag

First: We know that it is better to write the declarations of a class in header file And it's definition in another source file BUT if the class is template I have a problem to link the two files header and source it will appear two errors about linking Second: …

Member Avatar for farag
0
158
Member Avatar for Nemoticchigga

Hey, This may be real basic and Im just drawing a blank. How would you process a byte of info recieved over a serial port. I am writing a char*, recieving 1 (4 bytes) char at a time. I would like to return the entire read back as a char*. …

Member Avatar for Nemoticchigga
0
162
Member Avatar for Roebuc

Hello all, I have been working on a homework assignment that has to build a program for a user to enter student's grades and see the student's average as well as a class avaerage. Besides some cleaning up, organizing, and labeling I am pretty happy with it and it is …

Member Avatar for Roebuc
0
586
Member Avatar for msk88

Hi.. i want to execute a program(done using c++)when my computer is about to shutdown.i am using Windows Xp. how can it done??

Member Avatar for prushik
0
146
Member Avatar for vileoxidation

Hello everyone, and thank you in advance for any help you can give! I am working on a simple program with some long integers, which I have defined as type long long, with LLU after them. I am trying to use these variable names in an arithmetic expression, but when …

Member Avatar for vileoxidation
0
88
Member Avatar for MMill2373

I am having alot of trouble with coming up with a pseudocode and drawing a hierarchy chart for the following problem. If anyone could give me any pointers on what to do that would be great. Thank you !!!! [B] Develop the logic for a program that gives you the …

Member Avatar for MMill2373
0
142
Member Avatar for neomalwimalasen

i have following code in ATL COM class (There are existing methods and i added a new methosd) --------------------- STDMETHODIMP CCLS::GetCountryList(<parameters>) { //method body and return val } COM builds successfully. But from my asp code does not detects the new methos where as it detects all OLD methis. Note …

Member Avatar for Ancient Dragon
0
74
Member Avatar for p_conk

I have two header file Fibonaci.h, Fibonaci_Iterator.h, u can look below [U][B]Fibonaci.h[/B][/U] [code=c++] #ifndef __fibonaci__ #define __fibonaci__ #include "stdafx.h" #include "Fibonaci_Iterator.h" using namespace std; class Fibonaci { public: //typedef Fibonaci_Iterator iterator; Fibonaci_Iterator begin(); --> [B]syntax error missing ; before begin[/B] Fibonaci_Iterator end(); Fibonaci( const int& ); Fibonaci( const int&, const …

Member Avatar for Ancient Dragon
0
102
Member Avatar for kux

using visual studio 2005 this is the problem: say i have a solution with 3 projects: first - has some usefull utils functions and i build it as a static library second - a project that uses the utils. I link with the first and build as a static library …

Member Avatar for mitrmkar
0
82
Member Avatar for arby11886

The class should also have a function named compareTo which compares the Employee object to an Employee object passed to it and returns 0 if they are equal, <0 if the current object is less than the passed object, and >0 if the current object is greater than the passed …

Member Avatar for mitrmkar
0
182
Member Avatar for komal.Sam
Member Avatar for mitrmkar
0
60
Member Avatar for Phlip

I'm sort of a beginner at coding and C++ but I have successfully created a few small programs. Now my problem is that if I send my friend the program I just wrote (using Microsoft Visual C++ compiler) they can't open it. They are using XP like me but it …

Member Avatar for Nick Evan
0
152
Member Avatar for Jiko980

Hey there everyone! I found this site because I was looking for some help with my c++ course. I am trying to figure out how to make a program that can read in data from a .txt and then replace every 7th word with an underscore. It must print out …

Member Avatar for Jiko980
0
134
Member Avatar for siri_chow25
Member Avatar for Techboy1523

Ok I have to print two charts: one showing kilometers per hour converted to miles per hour and the second showing degrees Celsius converted to degrees Fahrenheit. The speed conversion table should list speeds from 50 to 130 kilometers in increments of 5. (50, 55, 60 …) The temperature conversion …

Member Avatar for Techboy1523
0
649

The End.