49,761 Topics
| |
I'm trying to read numbers from a data file into array but when I compile and run nothing shows up. what did I do wrong. I have to do all the reading from the function readData and I need to get rid of the header line but I just put … | |
cout << "Enter Student ID (999 to end): "; cin >> searchId; inFile.open(file + ".txt"); inFile.ignore(80, '\n'); while (searchId != 999) { for (int i = 0; i <= count; i++) { inFile >> ID >> lastName >> firstName >> q1 >> q2 >> q3 >> q4 >> final; if … | |
I am trying to create a multiplication table that is left aligned with a line under the header and a line next to the first column on the left. What I have here gives me what I want but without the lines. Can anyone help? 1. #include <iostream> 2..#include <iomanip> … | |
Hello! I'm new here, so correct me if this is the wrong location... but I'm trying to make a program for the Minecraft server I'm on, and it requires that if someone wants to make a map that is used on the server, that there's a .xml file that shows … | |
If I don't know the size a string will be, and if that size may change later, and if that string may contain '0' characters, what methods are there to do this? (I would prefer a professional/reliable method if possible) | |
Hi All I am VC++ developer and trying to Automate Microsoft Outlook and got stucked at one point so need your help indeed. Expecting your reply for my question. what i want to achieve is :- I have few contacts in my application and i want to transfer them to … | |
Anybody know what the below means. I'm building Gnuplot on Windows XP with a MinGW compiler. It could have something to do with the flags at the top of the message below but I don't know how to work that out. Error starts 8 lines down. gcc -DHAVE_CONFIG_H -I. -I.. … | |
can anyone give a hint in Complete Binary Tree Insertion ????? | |
Hey guys, i'm kinda desperate.. because of illness I had to miss 2 months of uni, I was seriously sick and could not even leave house for that time, now it's an exam time and I have no idea how to write it.. fortunately our teacher gave us 8 small … | |
First off, some setup. I'm doing the final course project for my C++ class, and this is the first time I've had trouble. The things I'm supposed to be doing in this assignment seemed a lot simpler before I started working on this, and now I'm just hitting walls. The … | |
Hi! I am working on a project in which I have some variables & I have assigned certain default values to those variables.Output of the project should be somewhat like as shown below :- a = 10 b = 20 c = 1 d = 4 ... & so on … | |
I was wondering if there is any way to parse integers from a string (like in java)? Anyone know of a built in function in c++? | |
I am using one dll in my application for including the functionality provided by that dll . This dll i am getting after installing one msi . But in my application i have a requirement like if the user has not installed that msi then we have to show one … | |
Hey, I have a function in C that I am trying to convert over to C++. I have done everything, apart from this line: memcpy(mel[i],&temp[melstart[i]],mellength[i]*sizeof(double)); I need a way of copying the elements in temp[melstart[i]] over to a vector of doubles.. Here is the C code: void Setup_Mel(int fft_size, int … | |
Hello everyone, I am working on one program that generates a lot of data...eventually it can be in GB range. And the way I am doing it now is just by writing to ascii file everything time... like this: ofstream flowC("outputfile.out"); // declared at the start flowC << prevsid << … | |
Hello all, I have a class with a std::set member that I am trying to send to terminal via std::cout. I am trying to achieve this by iterating through the set and dereferencing the iterator. I am unable to achieve this. Anyone able to point me in the right direction … | |
I am working on a math tutoring program that asks the user two random numbers from 10 to 100, and asks them to key in the correct answer within 5 seconds .the program must ask ten questions showing them and then display the score | |
I'm new to win32 application building using C. I'm using DEV C++ and I'm able to get a window, by using the "windows application" icon in DEV. I want to know how to display our text on to the window??? That'll be very helpfull! This is the readymade code generated … | |
I'm trying to iterate through a struct, but wanted to be able to do something along the lines of: string searchy = "jimmy"; string suffix = "firstname"; for (person dude : pnum){ if (dude.&suffix == searchy){ // Do things } } For those familiar with Perl/PHP, I'm trying to accomplish … | |
Ok... Got a lab to generate 150 random numbers and then sort the 1st 50 by BUBBLE SORT, the 2nd 50 by SHELL SORT, and the 3rd 50 by SELECTION SORT. After I get those three to work correctly then I need to MERGE SORT the three of them together. … | |
Hello I have been thinking for a while on how to do this one program in c++. I am trying to make a quiz in c++ with 4 yes or no questions. After the quiz has been taken I want to have it ask another question depending on how many … | |
#include "B.h" class A { public : A() { s_b = new B(); b = new B(); } static B s_b ; B b ; }; #include<iostream> using namespace std ; #include "A.h" int main() { cout<<"hello"; } In my project i have seen static object as above . But … | |
I have a some libraries which have a lot of common classes but the namespaces are different. Most of the code I was writing could be easily reused by classes in both libraries so after some reading I tried a technique of using the templates to pass namespace. As you … | |
I'm trying to output data to a file. I half killed myself trying to get the program to work , everything works all data is working except for a few errors will show later. Heres my code // Week 13: In Class Exercise - 5 Solution #include <iostream> #include <string> … | |
I have started writing a *really* basic tile engine in C++ and I'm not entirely sure when to use const return values. Should I use them in cases like this class A { private: Rectangle hitBox; public: A(); const bool Collision(const Rectangle& hitBox2); }; or is it totally pointless? | |
Hello all, A simple problem for anyone who know Qt, I'm very new to Qt and GUI programming in general. I’m on a linux platform and using Qtcreator. I have a window (see [here](http://1.bp.blogspot.com/-QM3EiY3oh5Q/UMeo8rb4fUI/AAAAAAAAAWY/tWPLdEl6OgM/s320/box.png) for a screen shot). I wish to have two "sub regions" (incorrect terminology I’m sure) within … | |
| is it possible to pass an already defined function into a pthread? so for example within my code i am able to define an array size once a user enters an array size(for example user enters 200) it will add the numbers 1-200 to an array , i then have … |
10-4. Write a class that implements a list that holds strings. 10-5. Write a bidirectional iterator for your String_list class. 10-6. Test the class by rewriting the split function to put its output into a String_list. there are theses three exercises in the book I'm studying, what is it asking … | |
#include<iostream> #include<cmath> #define pi 3.1415926535897 using namespace std; int main () { double lat1; double long1; double lat2; double long2; // initilaise values double latz; double longz; double a = 0; double c = 0; double distance = 0; double x = 0; double y = 0; cout << "enter … | |
if i want an array of 10000 ints and i just nned to use it like array only (not the functions which vector have seprately from array), then i make an array int a[10000] and vector<int>a(10000); then memory allocation time will be different for them ? if yes, then please … |
The End.