General C++ Programming - April 2013 (Page 6)

Reading strings from file to a 2d array?
 
I have a text file with scores and names. I have to read the score into an array and the names into an arrays also 27,Tom Jefferson 23,Ozzie Osborne 18,Wilt C...
[8 replies] Last: Line.substr() is a function that returns a string from the position to... (by pogrady)
voter program
 
In my class we were suposed to write a program from the book that inputed the names and votes and the program is suposed to spit out who won the vote. I did thi...
[2 replies] Last: I am not sure what you mean by this. (by crchristmon)
Help please with reading into a linked list
 
My program is supposed to prompt the user if they want a student object or employee then let them enter the data. The program continues to crash after prompted ...
[2 replies] Last: It is extremely rude to delete your posts so that nobody else may bene... (by cire)
Problems with retrieving forst three bits of a number
 
Hey,I am trying to retrieve the first three bits of a number. The code that I am using should work but it isn't giving me the correct result when trying certain...
[2 replies] Last: Thanks. (by tnjgraham)
Reading past whitespace in a String
 
Hello All, I am trying to read IP and Port from a string with the format IP : Port. But I cant figure out how to read past the white spaces after the IP and ...
[no replies]
by DAU
How to read single bytes from wifstream
 
I think tile says nearly all: I want to read a single byte from a wifstream. With an ifstream I would use read(), but given that the char type for an wifstre...
[3 replies] Last: Either you're using wifstream, and letting C++ do the conversions, ... (by Cubbi)
help. having trouble converting c to c++
 
#include <stdio.h> #include <string.h> #include <math.h> #define r 1e+3 #define m0 100e+3 #define g 9.81 main() { double m(); ...
[2 replies] Last: thank you. it calculates rocket launch trajectory (by redhippo33)
Help with a function to check for doubles
 
I cannot figure out why the program continues to prompt me for a vaild number even when the correct number( a gpa) is entered. I'm not sure if the problem lie...
[1 reply] : I would propose this instead: bool isDouble (const std::string &st... (by Bourgond Aries)
C# or C++ Program Source Code for Autopilot Helicopter
 
I'm using Microsoft Visual Studio 2012 to write a code into the USB driver port directly. I am using a Art Tech Genius 500 Helicopter and a Logitech G940 to ope...
[no replies]
Function does not take 3 arguments?
 
I am doing a problem where I need to use arrays of string objects that hold 5 student names, an array of one character to hold the five students' letter grades ...
[4 replies] Last: Oh I see I got it thanks guys!! (by bingaloman)
Style and performance question
 
Which is better: { char temporary_char_c; string temporary_string_s; for(int i=0; i<some_n; ++i) { //some code that uses c and s } } or char...
[4 replies] Last: `c' is uninitialized, so they are both crap Sorry, assume they are i... (by Script Coder)
by stdeez
HELP PREASSSEEEEE
 
bool simpleQuestion::checkAnswer(string guess) const { for (int i=0;i<qAnswer.length();i++) if (qAnswer==guess) retur...
[2 replies] Last: bool simpleQuestion::checkAnswer( std::string guess ) const { for... (by JLBorges)
Help with bitmap
 
I have a bit of code here..my question is that why is it divisible by 4? while((scanline_bytes + padding_bytes) % 4 != 0) padding_bytes++; ...
[2 replies] Last: Thank you! (by melissa9675)
please help
 
if (node->data == prefix) return true; else if(node->data < prefix) search(node->left, prefix); else search(node->right, prefix); how...
[1 reply] : can you post all of your code, preferably with [code ] [/code ] tags? (by closed account Dy7SLyTq)
Classes
 
Why are classes normally defined in a header file separate from your main program?
[2 replies] Last: + Implementation should be hidden(will give option for you to share y... (by chinchu)
Class
 
What is a parent class?
[2 replies] Last: Please read Inheritance in OOPS http://en.wikibooks.org/wiki/C%2B%2B_... (by chinchu)
stack smashing
 
hi all, i encountered some stack smashing error because of this set of code. i have no idea why this happens on linux, it runs fine on code blocks on windows ...
[5 replies] Last: You were getting "lucky". Accessing bad memory may or may not "work".... (by Disch)
by Maissa
PLEASE HELP
 
it only calculates one circle and i cant fix it #include<iostream.h> #include<string.h> class circle{ private: int r,ar,c; public: circle (int r1){r=r...
[3 replies] Last: @theideasman , this question was given to me in my exam so when i aske... (by Maissa)
Sweep line algorithm applied to segment intersection
 
Hello! I need advice on updating binary search three. I am working on implementation of Bentley-Ottoman algorithm for finding intersections of line segments in ...
[1 reply] : Isn't there anyone who was working on this problem out there? I could ... (by Nina Sma)
Area and Volume of Cylender
 
Hello friends, I would like to calculate area and volume of cylinder but radious and height should be integer, float and double. How can i do? May you help me...
[no replies]
April 2013 Pages: 1... 45678... 53
  Archived months: [mar2013] [may2013]

This is an archived page. To post a new message, go to the current page.