Beginners - July 2014 (Page 6)

Class, default constructor ":"
Hey, Can you guys explain me a little bit more the : after the default class constructor. For example class someClass{ private: float x, y; ...
Jul 28, 2014 at 9:58am
[4 replies] Last: Note: someClass(float _x, float _y) is not a default constructo... (by closed account z05DSL3A)
Binary predicate help
Im a little confuse on binary predicate If i got a code like this bool Generic_algorithm::isShort(string &s1, string &s2){ return s1.size() < s2.size(); } ...
Jul 28, 2014 at 8:55am
[6 replies] Last: Thanks guys i got it now (by procastination)
Operator Overloading in Value class
I was reading this code in a book and i dont get it can any body tell me what is going on in this?? this was about operator overloading in value class.... ...
Jul 28, 2014 at 7:32am
[8 replies] Last: Visual C++ != C++ though... Visual C++ is a product not a language, ... (by closed account z05DSL3A)
Sending form as parameter in c++
int main() { Form1^ myform1 = gcnew Form1(); myform1->comboBox1->Items->Insert(0,"String1"); myfunction(); Application::Run(myform1); } int myf...
Jul 28, 2014 at 7:23am
[2 replies] Last: How to send a win32 form as parameter to another userdefined function... (by closed account z05DSL3A)
Strings
hey guys would you plz tell me what is the difference between at() and these operators in accessing the characters of string ...which one is better and why??
Jul 28, 2014 at 4:51am
[1 reply] : http://www.cplusplus.com/reference/string/string/at/ http://www.cplusp... (by lsk)
3 sorts of random arrays
Write your question here. Can someone explain to me what is wrong with this program. It is supposed to sort a random array of 5000 elements by three different ...
Jul 28, 2014 at 4:23am
[1 reply] : int list1 , int list2 ,int list3 ; int list1 , list2 , list3 ; v... (by lsk)
SUPER BEGINNER class question
What are the contents of the two Name variables after each of the following statements assuming they are executed in the order listed? class Name{ public: s...
Jul 28, 2014 at 2:44am
[2 replies] Last: Your output is correct. Well... except for the yourName=^ and myName=... (by discofire)
Need help with a hw question that involves structs and functions
to keep things simple the question asks me to read a menu for restaurant from a file, have the user place an order and then print out a check. The problem for m...
Jul 28, 2014 at 12:52am
[4 replies] Last: Thanks Yanson, that worked. :D (by unkn0wn0192)
Nested loops
Hello can someone help me understand the first if statement, i know what % does but both i and j are the same number all the time? or am i wrong? int...
Jul 28, 2014 at 12:20am
[7 replies] Last: What i still don't understand is when does 'j' go up because both the ... (by Jacobhaha)
help understanding std::string erase
Hello, i have been looking at strings and im curious why the code snippet attached doesnt remove all the punctuations in string a!.. #include <iostream> #i...
Jul 27, 2014 at 11:18pm
[5 replies] Last: Thanks a ton :). (by Ozwurld)
Multi String Array Program
Here is the problem: Write A Program That Allows You To Enter Cd Names Into An Array Of Strings And The Cd Artist Into An Array Of Strings. At The Beginning O...
Jul 27, 2014 at 9:06pm
[1 reply] : I figured it out... #include <iostream> #include <string> using n... (by dash127)
Global class member?
Hey, I'm new to the forums, and got a little question =]. Let's say that I've got a class wich adds an item to a <vector> , and when I press for examp...
Jul 27, 2014 at 8:31pm
[4 replies] Last: Sorry, I did not pointed out, but in my program, it's not actually a f... (by Vect0rZ)
Switch statement vs if else
They seem like they are the same and can both be used for the same program so my question is is there any situation were you may need to use one over the other ...
Jul 27, 2014 at 8:19pm
[7 replies] Last: I don't know of anyone who recommends switch as bad practice. The swi... (by Duthomhas)
Array Initialization
How can I put default values to all the elements in a char array. In an array of Integers, We can use: int a ={0}; But the same doesn't apply to arr...
Jul 27, 2014 at 8:07pm
[7 replies] Last: @keskiverto: Thanks, I get it now. I'm gonna try the one-liner and see... (by newbie456)
character arrays
If wanted to take a character array such as "Hello! Whats up?" and wanted to turn it into this: "hellowhatsup". How would i go about doing that? Also i woul...
Jul 27, 2014 at 7:51pm
[2 replies] Last: Excellent! Thankyou (by RobHubbard)
Using variable in System() function?
Hello How can I use a variable in the system() function? Like this: string a; cin >> a; system("ping ", a); (Just an example). Of course that code doesn't...
Jul 27, 2014 at 7:00pm
[3 replies] Last: Thanks all! :) Worked like a charm. (by Nielyboyken)
Printing the largest number from a .txt file.
Hello, I need to print the largest/smallest number (age) from a text file along with the Name of the person it is associated to. The .txt looks like this: ...
Jul 27, 2014 at 6:56pm
[no replies]
Practical use of code?
I have had no issue learning the use of cout and if and else if and while/for, #include <cstdlib> .etc because all of these things make sense to me and serve ob...
Jul 27, 2014 at 6:26pm
[8 replies] Last: If i remember right, the book I linked earlier uses an inventory to ex... (by admkrk)
Using the sprintf function? C++
Hello I try to use the sprintf function but it doesn't work, could someone explain me what I am doing wrong? :) #include <stdio.h> //... char sof , c...
Jul 27, 2014 at 5:57pm
[9 replies] Last: Code doesn't work, I tried to edit it my own way as well but still no ... (by Nielyboyken)
"Opposite" of cin.fail()?
Is there any way to detect when cin succeeds, like how cin.fail() looks for when it, well... fails?
Jul 27, 2014 at 5:18pm
[3 replies] Last: Alright, that makes sense. Thanks! (by MI Wright)
July 2014 Pages: 1... 45678... 43
  Archived months: [jun2014] [aug2014]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.