General C++ Programming - November 2009 (Page 4)

C++ Syntax Error Issue
 
Hello all, I am new to C++ and I need a little help. I am debugging some code I wrote, and I get the following error: Error: String literal syntax error...
[5 replies] Last: I thought I had poured over all the code countless times, and as I wen... (by homecheese101)
time delay measurement
 
Hi, Does anyone know of any tool that would measure the time spent in a C++ program? I need the measurement-granularity of upto each line, and not each funct...
[1 reply] : The functions from ctime should help you: http://www.cplusplus.com/ref... (by Bazzy)
Printing contents of an input file to the screen
 
My program is supposed to read from this output file and print the contents to the screen NOTHING IS BEING PRINTED: CPTR151‐01 000143 Doe John Q 10 5 ...
[2 replies] Last: The problem is that the output wont print to the screen. When compiled... (by babe20042004)
Matrix recursion
 
Greetings everyone! I need to make a recursive funktion for matrix inversion, and was wondering if anyone here could help me? The matrix should be added as an...
[1 reply] : Post your code please. (by Zhuge)
My Program Wont append
 
#include <iostream> #include <fstream> using namespace std; int main() { int num=0; int tot=0; ofstream myfile; myfile.open("payroll.txt"); ...
[2 replies] Last: Thanks! Such a simple error! (by babe20042004)
Arrays and Strings
 
I need to write a program using arrays and strings.Here is the question. A class of students takes a 20 question multiple-choice exam;each question has 5 choic...
[1 reply] : Please declare student_count in your program... There is no declarati... (by chakde)
Convert from FILE to fstream and vice versus
 
Dear everyone, I am writing a C++ program and using fstream(ifstream and ofstream). Additionally, I am using a C open source library and its methods require...
[2 replies] Last: Thanks helios. If so, is there any similar function in Linux? Or is... (by strongdevil)
by funny
how to re-write each line in text file easily way
 
hi, im trying to make a function which could (in for statmnt) read format from file, delete same line and write there data from stdin... i was thinking how t...
[4 replies] Last: does he have to close the file before opening it again for writing on ... (by herbert1910)
Runtime error #2 Yahtzee program
 
I am in the process of writing a little Yahtzee program out of boredom. However, I have stumbled upon a little error that I cannot seem to solve. I used an inte...
[5 replies] Last: Ok, I've used std::getline() before, when trying to get strings as inp... (by Matt23488)
planitary motion
 
i wan to make a program that will simulate the earth orbiting the sun. i have all the opengl experience i just don't get the physics behind it. can anyone help ...
[6 replies] Last: [quote=helios]Or unless the camera is behind the Earth, with the Sun i... (by Duthomhas)
Why integer booleans?
 
I find that many people redefine integers to be booleans. As a boolean can easily be represented as a single bit with 0 or 1, I cannot help but not understand t...
[8 replies] Last: char myChar = 'h'; myChar is 1 byte. char myChar = "abcdefgh... (by Kangaroux)
by wany
Using current sytem time in program
 
Programming language c++ I have this project and what i have to do is get the current system time (which i alreayd know to do ) get a user input start time and...
[no replies]
[c/c++] video library...
 
hi everybody!! i would like to write a program that can open, show and modify a video. actually at the beginning it would be enough to me also beeing able to ...
[12 replies] Last: calm down guys, please... I did not specify the OS, so i think both... (by mamo139)
cin.getline for int, or cin for strings?
 
Okay, so I'm supposed to be writing a program that will take data in from the keyboard and then output it to a data file. I was trying to use cin for the strin...
[1 reply] : You should read this: http://www.cplusplus.com/forum/articles/6046/ (by Bazzy)
Having problems with TURBO c++
 
I ran the following program in Turbo C++ and got some errors related to the usage of the new operator. However, when i ran it in UNIX, or the g++ version of UNI...
[3 replies] Last: Man, just dont use Turbo C, it's totally out-standard. (by outsid3r)
by wimvd
maximum allocation size not reached?
 
Hi, To store data from a precalculation on about 1100 images and 830000 features, i'm trying to allocate about 3.5 gigs of memory but it seems not to be work...
[2 replies] Last: [wvandam@cancer ~]$ ulimit -m unlimited Unlimited should work. :) (by wimvd)
How to restrict automatic Type conversation in C++?
 
I want to restrict automatic type conversation in C++ function calls. I have the below piece of code in which a function is called which takes an int value, ...
[3 replies] Last: I agree with kbw's solution. (by jsmith)
sprintf vs stringstream
 
Are there any advantages to using sprtintf over stringstream? Is it any faster since it does not dynamically allocate memory?
[1 reply] : When you can choose between C and C++, always choose C++. So use stri... (by Bazzy)
Init 2D Vectors
 
How can I initialize a 2D vector at the place where its declared. An single dimension vector is done as shown below:- std::vector<double> my_1Dvector(10,0....
[2 replies] Last: thx a ton! (by luckycusp)
by bzz77
C++ beginner's questions on vectors of vectors (declaration, definition)
 
Hello everyone: I am a C++ beginner. I have questions regarding vectors of vectors. I have read the available threads on this topic and would very much app...
[2 replies] Last: Hi Disch: Thanks a lot for your example and for your advice about u... (by bzz77)
November 2009 Pages: 123456... 16
  Archived months: [oct2009] [dec2009]

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