General C++ Programming - October 2011 (Page 7)

Little help with some Homework.
 
I am currently enrolled in a C++ class online, and I am a little behind as it has been a few months since my last class. The instructor is wanting us to build a...
[no replies]
Taking an Input from a C++ Gui into another C++ program
 
I am currently developing a C++ program that does all the mathematical calculations, prints items to the screen that is scanned in by an RFID Reader, and allows...
[no replies]
Trouble with char to string errors!!!
 
Hi there, I'm kind of a noob and have a software engineering assignment... Heres the question. 10 marks) Chapter 4, Programming 8, p. 168. Write a C++ progr...
[1 reply] : Assuming you're having problems with bracketstack.push(str.at(i)); ??... (by andywestken)
Although I have included header file multiple times without using include guards, the code compiles without no error
 
I have a question about include guards. I assume that if you include your header file in multiple source files you should get compilation error, so to prevent t...
[5 replies] Last: No problem! :P (by friedEggHead)
by bruice
header files were included in the program, but cannot use them for errors
 
J just complied my program which include the header file BFSCfourier.h and pack_c.h.the BFSCfourier.h include the <fftw3.h> and the pack_c.h define these functi...
[1 reply] : These are linking errors, you need to link the library of pack_c.h wit... (by EricDu)
Finding Last Name and FirstName in Alphabetical order??
 
My teacher wants us to make a program that goes through two lists of students, if you enter a 10 it should go through one list, and if you enter a 14 it should...
[no replies]
Problems with segfaults.
 
I'm trying to code up a homework assignment (http://web.mst.edu/~price/cs53/fs11/h7.htm); When I run the output file, sometimes it segfaults and sometimes it do...
[2 replies] Last: If you use a debugger, it will identify for you the line that segFault... (by Moschops)
Swapping elements of arrays
 
I have a 3 dimensional array, of the form bool bit[L*L] where L is the size of the thing I'm simulating. At times I need to swap all the elements in a 2...
[2 replies] Last: I agree with bartoli -- but be aware that it increases your bookkeep... (by Duthomhas)
vectors
 
my question is regarding the max size of a vector (not the capacity of a vector!). the myvector.max_size() gives 1073741823 on my pc. suppose i have 2 vec...
[2 replies] Last: thanks...cleared my doubt (by coolcoder)
So I am trying to display numbers in different formats
 
Here is some things I need for the program to do and this is in C by the way first line: integer, right justified in a 10 character field hex representation...
[3 replies] Last: Er, so far you have only posted problems getting numbers, and you ha... (by Duthomhas)
by amika
convert hex string to uchar[n]
 
Suppose that I have a number in hexadecimal notation with size 2n , like "aa00F234AA" . I want to write it in an unsigned char array of size n ( "aa" in th...
[1 reply] : int chhex(char ch) { if(isdigit(ch)) return ch - '0'; ... (by Syuf)
Loop problems
 
Unhandled exception at 0x779015ee in hw7.exe: 0xC0000005: Access violation reading location 0x33612bd4. I am unsure of what this error means. Could someone h...
[1 reply] : (fall = false) You must write == for comparisons. = is for asign... (by bartoli)
whats the value of z?
 
int z=1; CT::CT() { z=2; } CT::~CT() { z=3; } void main() { z=4; CT*C=new CT; delete C; }
[1 reply] : Where? Is it really hard to follow, though? You know that new calls th... (by hamsterman)
How to write to specified file directory?
 
How would I prompt a user to enter a directory and then write to it? I've used ofstream to open a disk file and wrote it that way, but that doesn't let me speci...
[1 reply] : std::ofstream file1("/unix/absolute/path/to/file"); //Also valid on ... (by helios)
std::bad_alloc for 2D arrays
 
Hi all, I have a large 2D array in a loop, in each iteration of the loop i want to expand that array so I do the following: 1- copy the array onto a new t...
[8 replies] Last: I reimplemented that whole part using a single vector which just store... (by mohsaied)
How to turn it into a function
 
double radius; string input = ""; for(;;) { cout << "Enter the radius of a circle: "; getline(cin, input); if(!(atoi(input.c_str())...
[1 reply] : instead of getline(cin, input) to input a string number and then conve... (by buffbill)
8 Queens problem.
 
ive been having a few problems writing this program, the problem is to place 8 queens on a chessboard in such a way that no queen can take any other queen. i...
[no replies]
how to smooth arbitrary values without using an average
 
hi there, i'm doing a fan controler for my pc, and i'm having some problems smoothing the fans' acceleration. this is what i've so far, for the linear accelera...
[2 replies] Last: i was experimenting with other methods too, but in the end, yours was ... (by closed account 236Rko23)
Recursive function problem
 
Im trying to create a program that will employ a recursive that will estimate the square root of a number using the approximation NextGuess = 0.5(LastGuess -...
[1 reply] : I think that your initial formula is wrong: instead of nextguess = .5(... (by tfityo)
multidimensional array in a struct leading to core dumps
 
struct s { string s1; string s2; vector<float> v1; vector<float> v2; vector<float> v3; float arr1 ; float arr2 ; // PROBLEM...
[3 replies] Last: Try breaking up the array. Instead of allocating a huge 4-dimensional ... (by helios)
October 2011 Pages: 1... 56789... 36
  Archived months: [sep2011] [nov2011]

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