General C++ Programming - February 2012 (Page 38)

by Cole99
Char Help!!! PLEASE
 
Hi. I am pretty new to the C++ language and I need some help. Int makes number variables and char makes letter variables. I have been looking at codes online an...
[16 replies] Last: Thanks but I already got it. look at my 3rd post (by Cole99)
request for member ‘’ in ‘’, which is of non-class type ‘'
 
hi there i'm writing some codes (oop code) in linux (ubuntu) in witch class ellastic is defined as below in prelim header : template <int dim> class elast...
[1 reply] : This is a function declaration elastic<2> elast_opt() ; Remove the p... (by Peter87)
Iterator not treating item as its actual class
 
So, I'm working with a private dev kit for a multitouch device, and I've run into a bit of a snag. I'm using their iterator, which iterates through child Widget...
[4 replies] Last: HI , can you provide more details about .. ChildIterator (by bluecoder)
STL pass by reference
 
I have a buffer (sound) that I want to pass around for other objects (radio stations) to contribute to. I'm using the queue stl container. Can you pass such a ...
[12 replies] Last: ciphermagi, C++ is not Java. If the default behavior is to be not virt... (by aquaz)
Working with large digited numbers
 
Hello! There may be multiple threads on this topic, but i have not been successful in finding any of those threads, here and when I looked up the topic. So t...
[7 replies] Last: thanks to all, but i found a ibrary called BigInteger which works grea... (by swarage)
Pass by reference into a threaded function
 
I'm trying to pass by reference into a threaded function. The values get passed into the function, but I can't send the data out again. #include <iostream> #...
[2 replies] Last: This is perfect! I just installed boost today so I haven't figured o... (by Stewbond)
Need a 2nd set of eyes on this. Crashing with fwrite().
 
This is fairly annoying and I'm probably missing something super simple. I've tried a variety of things to try and nail down the issue(simpler text file name, e...
[8 replies] Last: Yea, fprintf fixed it, the write must have been going over the buffer ... (by Matt Boudreaux)
output of #define
 
I have a micro defined #define multi(a,b) a*b now what would be the output when I say multi(2+2,3+3) ? My compiler gives output as 11. But I don't un...
[5 replies] Last: Oops..right. Compiler doesn't care about syntax..How did I miss this t... (by incognito)
Dependency Injection and Database
 
Hi, I'm using dicpp to structure my application around dependency injection. I need to use an SQLite database to store and retrieve a large amount of data...
[3 replies] Last: Sounds like you have a big project planned! You need rock solid tools... (by mik2718)
how to call out the function. C++ keeps saying identifier not found
 
I am sorry. I cant call out the function. C++ keeps saying identifier not found. Thank you so much! Task: 1. Create a New Project and give your pro...
[7 replies] Last: Looking at the function body, there's no need to pass by reference her... (by MrHutch)
Game Programming - Component-based Class Designs (does that imply nested classes?)
 
INTRO Hey guys, this is my first post here on this site and I'm looking for some knowledge and enlightenment on a particular topic. The post might be pretty le...
[3 replies] Last: A nested class is pretty much the same thing as a normal class, the on... (by hanst99)
by Girija
Values stored in char *argv[]
 
int main(int argc, const char *argv ) if(argc != 5) { oops: exit(0); } if(strlen(argv ) != 3) { fprintf(stderr, "\nError --- must specify 3 rot...
[3 replies] Last: There is always something in argv #include <iostream> #include <stri... (by closed account z05DSL3A)
problem on 2 Dimension array : program breaks in dev C++ but runs fine on visual studio 2008
 
//runs as i wanted on Debug mode //runs well on visual studio 2008 // //doesn't run well when compiled and run on other compilers #include <iostream> using...
[2 replies] Last: Thanks i was confused for it ...and it was eating me for several days... (by helpMePlze)
the mastermind game cannot show the result in the round 2 or above
 
The first round of the game seems okay. The game will generate the result but >1 round , the result wont be show. And the is another mistake I found. For exam...
[1 reply] : I think rightpostion and rightnumber need to be reset to 0 after each ... (by vin)
by h9uest
Invalid template function?
 
Hi: I'm trying to define the following template function: template<class T> T str2Type(string str) // assume str will only be "int", "string" or "double...
[6 replies] Last: you can call the funtion in the main as str2Type<int>(str) b... (by bluecoder)
by PL285
Function Help
 
Hello this program is supposed to take input from a user for a desired car (model, maximum mileage and maximum price) and compare it with all the cars in the da...
[7 replies] Last: Step 1 : use vector to store the data from the file . Step 2 : ite... (by bluecoder)
UNABLE TO READ DATA FROM A FILE
 
I want my program to read a data file (i.e myData.dat) that contains strings, integers and character. I'm problem is that i don't know how to read these differe...
[8 replies] Last: the cursor is at the begiunning of the file in my input file. so i d... (by roberts)
More enlightenment, please.
 
I'm wondering if I'm breaking any C++ rules or best practices with this small bit of code, which is something I used quite a lot back in my ANSI C programming d...
[3 replies] Last: Getting this error: 1>c:\users\roberts\documents\visual studio 2010\pr... (by roberts)
Help understanding this homework problem
 
Ok so I'm trying to understand what I need to do for this homework problem and I can't seem to grasp it. This is what it says: Let c(n) be the number of diff...
[no replies]
recursive algorithms
 
I've wrote a small recursive function that calculates x n where x is a floating point number and n is an integer. My textbook tells me to use the following for...
[3 replies] Last: How would I know how many recursive calls were needed to solve a given... (by hopesfall)
February 2012 Pages: 1... 3637383940... 43
  Archived months: [jan2012] [mar2012]

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