49,766 Topics
![]() | |
Hello again. I am hitting a brick wall. I am to read data from a file, store the data in three arrays respectively, and then calculate and display the average of the numbers in column 2 and 3. These are the things I know: Read my data from file. Use … | |
hi i have two problems in c++ console application 1. I want a function to execute when a certain key is pressed .kbhit() is for any key but i want to modify it to a specific key ..plz tell me about it also if any other function can do this … | |
Two things. First I need to resolve the linker errors I'm getting and I also need to learn how to create a text file in a C++ project file. I'm working on a stacks project with classes and I'm running into linker errors. Specifically it says: [B][Linker error] undefined reference … | |
![]() | Hi everyone just started Daniweb! I have been using devcpp for some time.I am trying to make a switch from DevCpp to Visual Studio but find the latter confusing having so many options. Recently, I did a console application that will accept a word from user and prints its anagrams. … ![]() |
I am trying to make an 8x8 board with an array. The only problem I run into is making a box or square that will be placed into that array. for instance: @@@@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@@ … | |
this code is for bring an output of "Hello, [name]!" with frame on its outside. [CODE]//ask for a person's name, and generated a frame greeting. #include <iostream> #include <string> // say what standard-library names we use using std::cin; using std::endl; using std::cout; using std::string; int main() { // ask for … | |
First let me start by saying that I hope I wrapped my code properly. Next, my instructor sent us some code using a class and instructed us to add to it and make it so that we can display a checking account balance from a simple three line text file, … | |
Write a function which accepts a sentence as input parameter. Each word in that sentence is to b reversed (remember: not the whole sentence to b reversed, each word should b reversed). Space should b there between each word. Return the sentence with reversed words to main function and produce … | |
Hey guys, I need to print out character symbols for this program. I need to print 2 different shapes of symbols. For the first shape, I have to print out a triangle, represented by the "*" in the nested for loop. I need to print out a square shape using … | |
Hello I have hit a wall with this issue, been at it for a few hours now and it is bewildering to me to say the least With that being said, the below code is giving me some erroneous answer during the execution. The user enters a number from the … | |
How do i constantly keep checking for specific characters in a text file till there are no more specific characters left. this way i can keep displaying text file logos on my application until there are none left in the text file being searched by c++ :) i did have … | |
Hello, as you can tell from my username I'm completely new at C++ and have no idea how to write a function that won't chuck up any errors! What I'm trying to do is to compare an inputted student's ID number to ones already stored in my current array and … | |
Write a program that will ask the user for the name of an item, the part number of the item, the cost of the item and the quantity of the item. The program will then calculate the total cost of the item. The program will also keep track of the … | |
| |
Alright to star off let me say sorry for my english typos. This question is not for a homework and in no way related to school. Im in 3d conception. But looking to get a program for personal use. I have a project i want to work on and need … | |
I have this project that takes a team name, how many members are on a team and the individual times. I need to output the teamname and times (in seconds) and then the total time of each team. I'm having trouble adding the total team times. [CODE]while(infile.peek() !=EOF) { getline … | |
I'm working on a school C++ program, and its my first that uses classes and objects. Its great fun, and I'm almost done. I have a problem with the search function, which involves several pieces of code- the .h files, the .cpp implementation file, and the main code file. If … | |
Hello all, working on an assignment for a class and I'm encountering something strange. After I'm getting a bad memory allocation exception upon exiting my program. After debugging the problem it appears to be a result of trying to make vector with negative length. The program runs fine until it … | |
I have a program which consists of two windows (hWnd, and picturewind). I would like to write code which takes an action every time a person clicks inside of the second window (picturewind) but not when the person clicks in the first window (hWnd). Can anyone tell me how I … | |
Hi all, 2nd week programming and face first into the wall again haha. As always I appreciate any advice or critique. I have a small c++ program that reads through log files from a program and scans for errors. For the most part it works really well but I'm trying … | |
Please repair my loop. [CODE]#include <iostream> using namespace std; int main(){ int size; cout << "How large a triangle do you want? "; cin >> size; for (int r = 0; r < size; r++) { for (int c = 1; c <= size; c++) { if (c <= r) … | |
Hi, I have drawn a human face using simple shapes such as big circle for the face, little circles for the eyes, lines for eyebrows and triangle for the nose. I have been asked to create a template for various expressions of the face (fear, happiness, disgust, etc). Once I'm … | |
Hi there! I would like a little help regarding the following code. The following code will wait for a non-blocking socket connection, and then wait to receive a certain packet. When the packet arrives, it will do something and then close connection and reinitialize it in order to be able … | |
Hello guys, I need some help with a program that finds all the prime numbers from 2 to 10000,here is what I have so far [CODE] #include <iostream> using namespace std; bool prime(int n ); void main () { int n,b; b=0; for (n=2;n<=10000;n++) prime (n); if () { cout<<n<<endl; … | |
CSV is more than just comma delimited fields. There are quoting and white space rules too. This is a short function as an example of a complete way to read CSV records line by line. | |
I am trying to use Minipar parser.hence i downloaded it from the following link [url]http://webdocs.cs.ualberta.ca/~lindek/minipar.htm[/url] then I created an environment variable MINIPATH as was directed in the "Readme" file.But when i tried to run it through devc++ numerous errors occurred.the log file is as follows F:\pdemo\pdemo.cpp:20:19: ptree.h: No such file … | |
Hi i could not specific Record from my binary file. This is the method to list out all records. [code] int student :: showall(fstream &fp) { student rec; fp.seekg(0,ios::beg); int i=0; cout<<"Position\tRoll No\t\tName\tBalance"<<endl; while(fp.read((char*)&rec,sizeof rec)) { cout<<i*sizeof rec<<"\t"; rec.show(); i++; } } [/code] While running this i got the below … | |
Hey everyone, I'm need help with a problem I'm working on. I am trying to write a code that will tell how many coins are in the amount of change from 0 to 99. My algorithm is: Get total value of change Set value of quarters to q=.25 Set value … | |
Hello all, I recently installed MinGW on my XP Pro box (SP 3). When I click on the shell icon, the resulting behavior of the MinGW shell console window is incorrect. Initially, the console opens up as it should, complete with frame and scroll bars, but after about 5 seconds, … | |
Is it possible to create a dynamic-sized array of structures within a structure? To provide some info, I want to read some student info off an input file, which includes some miscellaneous information, subject codes and corresponding marks. The number of subjects taken is also provided as a number in … |
The End.