General C++ Programming - April 2014 (Page 30)

Character arrays vs c-strings
 
Hi All, I have a huge confusion when it comes to character arrays vs cstrings vs String objects(c++). However I think that Unless and until I declare an ...
[3 replies] Last: Thanks all (by venkatacplpl)
Non Printable character TAB?
 
Hi All, Why TAB with ASCII value 9 is non printable character and SPACE with ASCII value 32 is printable?I can open any editor and press any of them and I se...
[5 replies] Last: @MiniPaaa Thanks lot ...very clear. @peter87,@ kannanmj Thanks for... (by venkatacplpl)
Xcode for mac vs c++ for windows : Question/Problem
 
I've written a code which works for both c++ and Xcode. When executed there are no errors. The only problem is I get different answers. Does anyone know why ...
[1 reply] : You are probably relying on undefined or implementation defined behavi... (by Peter87)
puzzled about global classes
 
I am puzzled about the following section of B. Stroustrup (2nd ed) "Names of global classes must be unique in a program and must refer to unique definitions. S...
[13 replies] Last: I didn't realize you were referring to pre-standard C++ Well, neit... (by Andreas555)
Newbie needs help
 
I try to use "rand" to create 100 string, I'm happy I succeed, but next step i wanna know how to count each number of letters and the frequency it shows. Her...
[1 reply] : #include <iostream> #include <cstring> #define NO_OF_CHARS 26 int m... (by kannanmj)
Arrays
 
Hi, I have one little problem with my program. It is taking the last test score I enter instead of the lowest test score. Anyone know why it is doing this? he...
[2 replies] Last: for (int count = 1; count < size; count++) lowest = array ; You forg... (by MiiNiPaa)
by kate24
Help with programming
 
Consider the class specification below. Write the prototype (i.e. header) of a member function to overload the insertion operator (i.e. <<). The << operator i...
[1 reply] : Code snip: class StudentTestScores { ... public: friend std::o... (by kannanmj)
is this possible with c++?
 
im not exactly sure how to ask this but when i goodled it it didnt come up with anything. is it possible to make programs outside of the terminal with c++? like...
[7 replies] Last: ok ill keep that in mind. im not sure if im ready for 3D game engines ... (by gopro2027)
General C++ Problem!
 
struct complex_number_packet { double real_part; double complex_part; }; class complex_number { public: friend ostream& opera...
[6 replies] Last: struct complex_number_packet { double real_part; double compl... (by kannanmj)
how memory leak.....
 
is there a way to delete a memory leak ? like when the pointer is no longer pointing to that memory address, and that allocated memory is not accessible, how c...
[6 replies] Last: There is: don't use new in the first place. http://www.cplusplus.co... (by LB)
Memory size of std::vector elements
 
Hello forum, I had a question about memory allocation/how iterators work for a std::vector<foo> of a user defined class 'foo'. Say foo contains variables of v...
[16 replies] Last: 1) the vector is implemented as a list/array of pointers to data. In ... (by helios)
by rgt13
Help
 
Can anyone help me write a decryption program that looks like this? I'm so lost since my teacher sucks and the book is very brief on the details **********...
[5 replies] Last: First things first, get the decryption working. Write some code into t... (by booradley60)
Attempting to make an image format
 
Title^. So far I have a general progress made, as I have the ability to do the following (during runtime/app execution): read/write a pixel in the struct based ...
[8 replies] Last: As for your question of "Is it a good idea to use the " " character as... (by cathyhill)
Problem reading text file
 
So the program is working fine except for this small problem. When i run the main loop the first time it works fine, but when I input a valid filename the seco...
[1 reply] : a) you can just make it like this on line 159: alphaArray alphabet = ... (by Little Bobby Tables)
Operator Overloading / Printing
 
Test code int main(){ Status_List s_list; s_list.add_status("Blind", 2); s_list.add_status("Stun", 5); s_list.add_status("Deaf", 3); ...
[4 replies] Last: @kemptofighter The first line of http://www.cplusplus.com/reference/ve... (by ciphermagi)
Ising Model in C++
 
I'm writing a code in C++ for a 2D Ising model. Here's what the code should do: 1. Generate random NxN lattice, with each site either +1 or -1 value. 2. S...
[no replies]
by semo
please help me!!
 
hi, can any one please help me with this... write a c++ program that reads an unknown number of integer values and then print count, sum and average of odd val...
[1 reply] : Don't post the same topic on different boards. This is a beginner ques... (by booradley60)
Multi threaded program using a modal dialog box
 
Hello, I am writing a piece of code using gtkmm and ran into this problem. This is how i am getting the problem. class someobj { Gtk::Window* pWindo...
[6 replies] Last: could you give an example? Edit: thanks for the suggestions, i think i... (by tejashs)
playing video using c++
 
hi, i am making a game of quiz and i want to play a small clip in one of the rounds, but i dont know how to do it in c++ so can anyone paste some lines of code ...
[3 replies] Last: Look into SDL and SFML - I recommend starting with SFML. (by LB)
by Kauto
Const data member initizialisation
 
Here's a part of my program. What I need to know is how I can pass an argument to the Book constructor so I can change the const data member Category (with casc...
[1 reply] : Book uses Shelfmark, but Shelfmark doesn't use Book, therefore the dec... (by AbstractionAnon)
April 2014 Pages: 1... 2829303132... 41
  Archived months: [mar2014] [may2014]

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