49,757 Topics

Member Avatar for
Member Avatar for DOPY

Hello i am using a public computer (im just starting out with c++) so i dont have the code on me but i have figured out how to create a text file. what i want to know is when i create it, it places it in the direcotry that my …

Member Avatar for DOPY
0
213
Member Avatar for kse989

The assignment is to, using the given header file, write an implementation file, a menu-driven test file, and a car wash simulator... [B][U]Please see attachment for complete instructions[/U][/B] This is what I have so far, I am having trouble with my print function... I am new to Queues and not …

0
72
Member Avatar for prushik

Basically I want to set up a 3-dimensional array, but I want to dynamically allocate memory for it. Say I read 3 variables from a file, all ints: f, s, and v. i want to allocate memory for array[f][s][v] array is part of a struct How would I go about …

Member Avatar for dougy83
0
86
Member Avatar for Monte

Hey guys i'm taking a c++ class and I know this is easy material but im not sure if a function call can have like m+n or FMAX and stuff. Any help with this would be great thanks. Determine which of the following function calls are invalid and explain why. …

Member Avatar for Ancient Dragon
0
114
Member Avatar for Jacky1

Hi I need help with the remove function in the AVL tree void remove( generic x ); Thank you guys

Member Avatar for Jacky1
0
89
Member Avatar for bigbadowl

I have written the code below to highlight words in quite large documents. Problem is: 1. It needs to be case insensitive, ie: "dog" or "Dog" should match "dog" 2. It currently matches words inside other words Can anyone help? Many thanks [CODE=cplusplus]void highlightTerms(vector<string> finalWords, string *source){ for (int i …

Member Avatar for ivailosp
0
115
Member Avatar for noraantonia

Hello, I just downloaded the latest gd library, unziped it - i downloaded a dll version and a source code version. I have problems whit using it in my msvc application. I will paste here the install specifications for visual c++ users : [code] [I]Instructions from the gd site :[/I] …

Member Avatar for noraantonia
0
598
Member Avatar for Arne Kristoffer

Hello! Is there any way that I could create a loop that will user the content from a text-file and the number of lines? I want to go through a file and look for something, and then I need to use line by line, not char by char. Maybe the …

Member Avatar for Narue
0
77
Member Avatar for CNSK207

Hey I'm new here to these forums and I'm in need of some help with my program. I'm supposed to write a program that will allow the user to enter up to 100 values into an array. The program will then count how many values were entered and display the …

Member Avatar for vmanes
0
112
Member Avatar for Black Magic

Help please, just made this little program, no errors but it does not write any text for me on Dev-C++. [code]#include <iostream> using namespace std; int main() { system("title Array Program."); int myArray[5]; int loop; for (loop = 0; loop > 5; loop++) { cout << "Value for myArray[" << …

Member Avatar for Black Magic
0
81
Member Avatar for skatamatic

I've recently made a pi calculator out of a pretty rediculous algorithm (which is incredible accurate by the way). Unfortunately, C++ doubles can only hold 16 digits of it! I know that's plenty enough for any practical applications, but I want more accuracy! (Call me insane). I'm just looking for …

Member Avatar for skatamatic
0
144
Member Avatar for dkwantee

Hello! The text file is separated by tabs..I have used a struc as below: [CODE]struct scores { int maths int phy; int bio; int chem; int eng; int total; }; struct class { int class_id; char name[50]; }; ifstream fin; fin.open("marks.txt"); char buf[100]; string a; getline(fin,a); char delims[] = "\t"; …

Member Avatar for Lerner
0
510
Member Avatar for buddha527

I was given this code by my professor [CODE] main.cpp #include "home.12.h" int main() { cout << mystery(30) << endl; return SUCCESS; } // end of main //========================================= functions.cpp #include "home.12.h" int search(int first, int last, int n){ int returnValue; cout << "Enter: first = " << first << " …

Member Avatar for buddha527
0
110
Member Avatar for driplet

I use the following code to read data from a txt file: File2Open = "data.dat"; if((In=fopen(File2Open,"rt")) == NULL) { Application->MessageBox("Open data file failed.", NULL, MB_OK); return; } handle = open(File2Open, O_RDONLY); do { Readin1; Readin2; }while(!eof(handle)); Readin1 and Readin2 are two subroutines and consist of many lines of fscanf(In,"%s",&TTT) to …

Member Avatar for Salem
0
106
Member Avatar for tootypegs

Hi, at the moment i have a program that examines a file, does some processing and then outputs the results in a file. Is it posible to examinemultiple files stored in a folder all at once, then output the report files in a seperate folder without having to run my …

Member Avatar for tootypegs
0
110
Member Avatar for computer engW

Hi everone, Today i have a question has two parts and i did what i undrstood.If threr are mistakes ,please tell me. The Question is: [quote]father decided to buy a new vehicle. He paid 20,000 QR in cash and the rest will be paid on settlements as follows:  1500 …

Member Avatar for Black Magic
0
101
Member Avatar for Nemoticchigga

Does anyone know the size of an enum? If i have [CODE]enum foo { YES, NO, MAYBE };[/CODE] is that 1 byte, but if i had 10 enumerations would that be 2 bytes, and so on? Thanks.

Member Avatar for Narue
0
114
Member Avatar for daviddoria

I have 2 classes, Edge and Point. Edge contains Point P1 and Point P2 as private memebers. Edge has accessor functions [code] Point getP1() { return P1; } [/code] and the same for P2. Point has << overloaded - [code] ostream & operator << (ostream &output, Point &p); [/code] I …

Member Avatar for daviddoria
0
132
Member Avatar for amt_muk

Hi What are the basic differences between the methods atol() and strtol()? Regards, Amit

Member Avatar for amt_muk
0
428
Member Avatar for ahjiefreak

Hi, I recently has a C++ code which only run on Fedora Platform. I wanted to run debugging on these code as I came across some unexplainable scenario output. Can anyone suggest how could I use any debugger? I tried to use GNU GDB but then the code I am …

Member Avatar for ahjiefreak
0
225
Member Avatar for heav_yduty

Hi! Sorry, I couldn't find close topic. But maybe somebody can help me with my problem? I create a Word document, and I don't know how to paste the values of my variables in the document. For example, if i have the variable - int sum = 20, how can …

Member Avatar for heav_yduty
0
82
Member Avatar for Black Magic

Hi, im just bored so was mucking around on Dev-C++ and then was wondering - how could i make it so my program said a random sentance, like if i defined loads, and it said one at random. Could you help :).

Member Avatar for Ancient Dragon
0
79
Member Avatar for allialli

I have a class assignment of writing a program that: Start with the following program code. Write the function called "increment" which takes one integer parameter and returns that value plus one. [code=cplusplus] #include #include using namespace std; // YOUR FUNCTION GOES HERE! int main() { int input; string keepGoing; …

Member Avatar for bugmenot
0
243
Member Avatar for computer engW

Hi ; I know how to solve the same problem if i have limit numbers ,but here i have n intergers .How can the compiler understanst me when i need n integers ,like this question: [COLOR="Red"]Write a program that takes an n number of integers and calculates their average.[/COLOR] Using …

Member Avatar for computer engW
0
87
Member Avatar for digital_ice7

why cant it work properly??? [CODE]#include <iostream> #include <fstream> #include <string> using namespace std; int main(){ ofstream out;//create output stream int acc_num[10]; for(int x=0;x<10;x++) acc_num[x] = rand()%10; //generate account number char acc_file[600]; for(int x=0;x<10;x++) acc_file[x] = acc_num[x] + '0'; out.open(acc_file, ios::out);//create & open output file out << "PACKAGE ID: "; …

Member Avatar for Nick Evan
0
105
Member Avatar for Suraine

i figure out that srand() and rand() are not quite good in creating a random number. for: [code]while(true){ int x = 0; srand((unsigned)x); int r = random(); cout<<r<<endl; }[/code] It gives back the same number. Am I doing something wrong? If not, is there anywhere that we can create our …

Member Avatar for vmanes
0
82
Member Avatar for veronicak5678

I am trying to write a "censor" program. here are the instructions: Write a program that reads a file of text and replaces each `target' word with its first letter followed by a string of asterisks that indicate its length. Have it read the list of target words from a …

Member Avatar for veronicak5678
0
183
Member Avatar for Yellowdog428

Wow, I am having huge problems passing values between functions and wrapping my head around pointers. For some reason when I tried to return values from functions they would not pass and when I tried putting pointers in the place, passing them kept giving me compiler errors. Now I have …

Member Avatar for Yellowdog428
0
96
Member Avatar for inamabilis

Hi, First off apologies if this is in the wrong forum - moderators feel free to move it if it is, or ask me to repost somewhere else. Now, my actual question is as follows. If I understand correctly by initiating a hook using SetWindowsHookEx then my hook will be …

Member Avatar for inamabilis
0
74
Member Avatar for WonderWomen204

I have to do an assignment for class. Here is what the assignment is: Start with the following program code. Write the function called "increment" which takes one integer parameter and returns that value plus one. [code] #include #include using namespace std; // YOUR FUNCTION GOES HERE! int main() { …

Member Avatar for Ancient Dragon
0
119

The End.