General C++ Programming - February 2016

by k 7
Pointer offset comparison
 
Greetings everybody ! Is there a clean way to compare two pointers, in order to no know which one has the bigger offset ? I need it because I have to write ...
[3 replies] Last: Yeah of course I can deal with the situation described by Helios. I ha... (by k 7)
How to create a file with Dev C++
 
Purpose: The purpose of this program is the following: Read in the input file and organize the data inside from lowest to highest. Send the new data into an ...
[4 replies] Last: Your problem description does not make it clear if you are only suppos... (by AbstractionAnon)
Looking for Matlab sortrows function in C++
 
Hi friends, I am translating codes from Matlab into C++. I am using "Eigen" library to make my life easier, which is a library that provides many Matlab-like...
[2 replies] Last: Here is the description: "B = sortrows(A,column) sorts matrix A base... (by landlord2017)
by doug4
Passing A Type
 
In my project I am generating template classes based on an input description. When working with integer types, for instance, I have to run through a list of ac...
[3 replies] Last: Hi, Just my two cents worth here :+) Could you have a play with boo... (by TheIdeasMan)
Help recreating strdup()...
 
Rules: No standard library functions may be used. No subscripting is allowed. Here's what I have: char* strdupl(const char* s) { //find length of s int n =...
[4 replies] Last: Yes it was! I'm pretty new to pointer arithmetic so I'm very sloppy ab... (by TinyTertle)
D&D Style Game (1,2)
 
I am given an assignment that I am to write a D&D Style Game using pointers and char arrays. The requirements are to have 3 files, 1) Character.h (which he give...
[22 replies] Last: My apologies. I finished the assignment, but I do not want to post the... (by dub1987)
by eazye
Problem with integration script
 
Hi, I'm trying to code a program that performs an analysis of the integral I = 0.9sin(pi*x) in the interval 0.13<x<0.87 using crude Monte Carlo methods. I be...
[no replies]
Creating Data File with C++
 
How can I go about creating a data file with the Dev C++ compiler?
[2 replies] Last: Purpose: The purpose of this program is the following: Read in the inp... (by LiberianMagic)
Comparing empty strings where ' string = "" '
 
This is something that I've always been curious about but was never sure how to ask. I've always thought of strings as just dynamic arrays plus encapsulation...
[5 replies] Last: It can be, but in my experience it isn't. Where we are now is the boun... (by Moschops)
./configure commands C++?
 
I'm having some trouble understanding something. This is general across building all C++ libraries but the problem I'm having now is with an fltk library. I'm...
[2 replies] Last: I'm using MSYS.. That's why I'm able to use ./configure If I want to ... (by dominover)
Error Check -- Not long
 
I cant get it to work, only a couple errors listed here....Its for my Intro to Programming class. It's suppossed to calculate overtime pay. Thanks for looking.....
[1 reply] : Your Intro to Programming class is teaching you to declare the main fu... (by sasauke)
Standard Deviation without arrays the Donald Knuth method
 
So. For a project we are supposed to write a file that reads a file containing numbers then determine the data set's mean, minimum, maximum, and standard deviat...
[2 replies] Last: This algorithm is due to Knuth, who cites Welford, .. 5. Donal... (by JLBorges)
Error check issue
 
I have been having trouble entering an error check to this code for when a user inputs a letter instead of numbers for the Celsius or Fahrenheit input #inclu...
[3 replies] Last: if a user enters a letter when it's expecting a number. The iostream i... (by keanedawg)
What is the syntax of this method header?
 
Hello, I am working on Win32 stuff and I came across a method header like this ATOM WINAPI RegisterClassEx( _In_ const WNDCLASSEX *lpwcx ); ATOM is...
[2 replies] Last: I didn't know such a thing existed in C++. Thank you. (by DarrenH)
finding error [ bubble sort ]
 
done
[no replies]
Trouble converting a postnet barcode into a postal zip code.
 
#include <iostream> #include <iomanip> #include <string> using namespace std; int string_to_num(string code) { // I have this to convert binary to a d...
[1 reply] : When posting code, please use code tags. Highlight the code and press ... (by dhayden)
for_each () disambiguation - 2 different ways from one function?
 
In the code below I am contrasting and comparing for-each loop situations on a normal array. Do the for-each() loops below appear "legal"? Am I using them appro...
[2 replies] Last: Ok, in the following example, to be starkly obvious I just made card_d... (by technologist)
by systux
Memory management and where to start.
 
I've read a few things on memory management so far, but as far as implementing it goes, I don't know where to go. I read that you can use a for loop and overloa...
[8 replies] Last: Not exactly lol. (by systux)
Banking application storing account info in array
 
Hello I've been working on a C++ banking application that should be able to hold more than one account with all the related field's. I have come across a few is...
[1 reply] : I know a for loop to accept the user's input and store in an array is... (by ScoobyDoo)
February 2016 Pages: 123... 21
  Archived months: [jan2016] [mar2016]

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