General C++ Programming - February 2011 (Page 6)

How do you set a variable in a char array declaration?
 
Like, if you made a char array: char Array = {{"aa"}, {"aa"}}; How would I fit in a variable into the brackets to set a poin...
[1 reply] : char Array = { { 'a', 'a', 'a', 'a' }, { 'b', 'b', 'b',... (by jsmith)
Real head scratcher
 
Ok I'm going to explain this to the best of my ability: Here is the code I want working: if(player == 1) { if(mInput->KeyDown(DIK_UP)) { mSpr...
[2 replies] Last: player is just an integer value that is passed to the program by a ser... (by joro550)
Trouble with arrays
 
I'm new to code, and i am trying to do a program with arrays. I'm starting with imputing characters into an array, and then i try to transfer those characters ...
[10 replies] Last: works great, thanks for the help! (by jakecodes)
Sorting a map by its value
 
Hi, I want to sort a <double,double> map by its value. For example if my map contains following entries map<double,double> myMap; myMap[10.01] = 12.16;...
[5 replies] Last: That will do. Thanks a Lot. (by rajimrt)
How many percentage do you know about Tower of Hanoi problem
 
hi everyone. i am working on the tower of Hanoi code and got a very interesting question. Here is the code of Tower of Hanoi problem: #include<iostream> ...
[no replies]
by Sieves
link error
 
my code is as follows //creates a 10 by 10 word search puzzle //words determined by a specified filed //word locations then specified by user //program cre...
[2 replies] Last: I thought i had fixed that last night before i went to sleep... well c... (by Sieves)
Having trouble with nan
 
I need c++ help. Hi, I just created an average program just for fun. I use the do-while loop so its user can repeat the program as much as he/she likes. There h...
[1 reply] : accumulator is not initialized before it is used. (And please use ... (by simeonz)
cant get this work new to C++ for class any ideas great
 
Iv been working on this program thats due tonight at midnight and I have no idea how to get to work its semi complex any ideas would be great thanks. David ...
[4 replies] Last: I think it's got something to do with like engineering networks or som... (by ceruleus)
by Sieves
error with string ><
 
Ok so i keep getting this error: Error 1 error C2248: 'std::basic_ios<_Elem,_Traits>::basic_ios' : cannot access private member declared in class 'std::basic...
[15 replies] Last: Sieves, unless your assignment says that you NEED to use functions the... (by ceruleus)
Arrays
 
consider the following array : int X , assuming that the right value (of the array) is L: what is the value of the expression X[-5][-10]?
[3 replies] Last: I'd be surprised, because the C++ standard says that access elements b... (by jsmith)
STL Container Question
 
Slightly simplified example: std::list< std::pair<int, int*> > example; example.push_back(std::make_pair(1, NULL)); example.back().second = &example.back(...
[3 replies] Last: Alright, good. That's basically what I thought, but I just wanted to m... (by firedraco)
Random crashing. Overflow or typecasting maybe is the cause?
 
I've been trying to debug this for a while and sadly I'm not even sure if overflow itself is the problem or what... I've narrowed it down somewhat to a singl...
[1 reply] : Have you considered using a vector in your nodes? You can then use at... (by kbw)
Nested For Loops
 
Ok, so its back to EECS 168 Lab work. right now we are working on nested for loops and we have a pretty simple lab assignment but for some reason (maybe im just...
[2 replies] Last: Shouldn't line 13 be sum+=pow(2,number) ? (by PiMaster)
how to make loops for character
 
hello guys, i'm just new here, can someone help me whats wrong with this code? I was suppose to input a name of a student then each student has 5 scores then I...
[6 replies] Last: Sorry for the late reply, was busy over the past week. 1) Problems ... (by Ultima)
send mail when code/run is finished
 
I am using c++ for my PhD project and I let it run on a unix server, which takes up to several days. Until now, I always have to check weather it is finished or...
[2 replies] Last: Thanks a lot! I am actually using shell scripts, so that is an easy... (by afitzner)
How to replace text file and use an array instead?
 
Hello Everybody, This program works and it use a text file named yes.txt with these lines and no blank line at the beginning or end of file: sing Sing SAN...
[5 replies] Last: You have to write the string and vector classes from scratch. I have m... (by krishnendu)
identifier problems
 
hi all, i've this program which is not working and the output give me the following errors, i though that the function prototypes will have solved this probl...
[1 reply] : Please i'm looking forward for any ideas; error C2065: 'prnt' : unde... (by kbw)
vector::size() failing
 
Hi all, I've got this code which is part of my first attempt at a partial minimax tree search, but when I call size() on the vector 'children_' which is a m...
[1 reply] : How do you know that they are skipped? (by krishnendu)
by br007
Variable Dependency
 
Here is the snippet of code I am having issues with. cout<<"So are you a male or female, Please type m/f"<<endl; cin>>sex; if (sex='M','m') { alcoho...
[1 reply] : You need to 1) use == for comparison. Remember, = is for assignmen... (by firedraco)
mem leak while storing pointers in vector<vector< void *>>
 
This is related to this thread: http://www.cplusplus.com/forum/general/36365/ I'm wondering if my code causes a memory leak. From what I've read, each use of...
[3 replies] Last: That failed. I got unique addresses, but apparently the vector destru... (by apfinger)
February 2011 Pages: 1... 45678... 25
  Archived months: [jan2011] [mar2011]

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