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

Reading files into ARRAYS
 
OK heres my problem Im trying to Read a file into an array. My data file looks like this ID NAME GRADE 1 John 89.97 ...
[1 reply] : there is no problem in this, you have to paste some more code. are you... (by writetonsharma)
by netP
Nested "include"???
 
Hi, I am confused of how to use nested "include"s, since I wrote some and g++ gave me several errors saying that I used undefined classes and " error: forw...
[4 replies] Last: Thanks, Disch! That helps! I changed the include statement to forward-... (by netP)
Exceptions and IF
 
Well, I can't see why(or when) should we use exceptions instead of the if statement. Other than catching dynamic memory error, such as bad_alloc(which is standa...
[11 replies] Last: 1 - The function itself. (by Disch)
How to check the keyboard without stopping? (1,2)
 
Is there a way in C++ to check if a key has been pressed without stopping the program? E.g.: while(true) { ComputeSomething(); if(keyPressed()) ...
[20 replies] Last: Boost has everything. It's almost annoying. (by chrisname)
Having problems getting information to file
 
This program is designed to anylize any character put into it from an input file as a letter,(capital, lowercase,consonate, vowel), digit (odd or even), and pun...
[5 replies] Last: Alright thanks. No we have not covered globals yet in class, so I thin... (by ralph26)
by Null
Question about "operator new"
 
Hello, just a quick question about new With new it's clear. E.g. char *c=new char ; // allocating space for 23 chars in memory but how about char *c...
[2 replies] Last: Almost the same. new T should be deleted with delete , but new T shou... (by helios)
Is the STL string class thread safe?
 
Just wondering if anyone knows if the string class in the STL is thread safe? And if so, around what time did it become thread safe?. Ive seen some code that us...
[2 replies] Last: Just to add... I know of no STL string implementations that are thread... (by jsmith)
Vector user-defined search function!
 
Hi I've been trying to figure this out for hours now and I can't get it so I thought I'd ask the genious' here for help. The assignment is to create three funct...
[2 replies] Last: search() does not return anything in particular if the loop does not r... (by jsmith)
invalid operands of types int and float to binary operator <<
 
Okay, so the program works until I add the last part on and then I get this error message: invalid operands of types int and float to binary operator << /...
[3 replies] Last: You have to pass them as parameters to the function. BTW, just a wo... (by jsmith)
wrapper function for new
 
Hi Guys, Actually, when we allocate memory using new we do it something like struct node { node() { cout<<"Constructor"; } ...
[5 replies] Last: I wouldn't even bother trying to catch bad_alloc as the result of an O... (by jsmith)
by fabio
bcc and makefile
 
Hello, I'm trying to compile a little project with the borland command line tools 5.5. I'm using a call to a makefile with: MAKE.EXE -f MAKEFILE -a -c ...
[4 replies] Last: If you're using bcc, and you have a make file that works, you'll find ... (by kbw)
c++ with databases like mysql/sqlite3
 
Hi Friends, Pls Kindly Help me. Thanks in Advance. When i tried to Connect c++ with databases like mysql/sqlite3. http://www.alhem.net/s...
[2 replies] Last: If you want to use sqlite3, download the amalgamated source from the s... (by kbw)
need a way to find and either replace or delete text from a text file
 
to start with, sorry about the length of the title, i rewrote the title 3 times and that was the shortest one i felt was accurate enough to use. now, to get ...
[11 replies] Last: Galik, that is neat! thank you. your stuff works even when there is... (by herbert1910)
by mnunez
Amicable numbers 2
 
int main() { int low; int high; //range cout << "input the start of the range: " << endl; cin >> low; if (low <= 0) { cout << "unable to ...
[1 reply] : Please put your code in code tags. This line: amicNums (int low... (by Disch)
by mnunez
Amicable numbers
 
bool isAmicable(int start, int end)//you want to give it a range, but to check we need an actual number (third param { //220 and 284 are the smallest ami...
[1 reply] : Please put your code in [co de][/co de] tags. Please tell us what... (by Disch)
by jrohde
Using OpenGL in VC++
 
Hello all, I was having issues with OpenGL in VC++, so I created the following simple test files and tested them under Dev-C++, which I previously had always...
[3 replies] Last: Thank you. That appears to have done it. Problem solved. (by jrohde)
map access outside class
 
Hi All, I'm new to C++. I need some help regarding the usage of map STL container. I've declare map proteinData in the below header file. ProteinData contains ...
[5 replies] Last: Thanks kwb, it is very helpful ..... (by gauravkr)
by c51
combining file open statement and declaration?
 
Isn't this how one would combine the declaration and open statement for a file ? ofstream fout.open("ofile"); ??? I get "... syntax error : missi...
[1 reply] : No. There are two methods(from what I know, might be wrong): ofs... (by mcleano)
pointer question
 
Consider the following code: char s = "Hello"; const char* pc = s; // pointer to constant pc = 'g'; // error My C++ book I'm reading says this is an e...
[5 replies] Last: The fact that you can change a const object using the const cast. You... (by helios)
Is it possible to loop a switch?
 
I'm writing a program and I'm wondering if it's possible to loop a switch because my program is suppose to emulate a process going into the critical section of ...
[2 replies] Last: @OP Don't double post: http://www.cplusplus.com/forum/windows/16404/ (by Bazzy)
November 2009 Pages: 1... 678910... 16
  Archived months: [oct2009] [dec2009]

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