Beginners - January 2012 (Page 6)

by TNT104
Array initialization
 
How can i initialize the two variables wiht 0? class student{ private: char *nam; float *grades public student(){grades...
[2 replies] Last: // class class student { public: student(void); ~student(void); ... (by Lynx876)
Error Reading file and populating object array
 
Im trying to read a file in of song data and populate an array of objects, but it will only read in the first line and populate all of the objects with the same...
[2 replies] Last: thank you, that fixed it (by savan12986)
Traversing through a 2D array?
 
I have a 2D array of ints and I want to check that within this array, only one value of each number 1 through N exist (for example, N being 9, that only 1-9 exi...
[5 replies] Last: Off the top of my head, I came up with the following code. It needs so... (by Lynx876)
trouble with getline and input files.
 
Hi. I have the following code snippet: ifstream infile; //Declares variable. ofstream outfile; //Declares variable. while(1==1) //Always true, ...
[7 replies] Last: tl dr Awesome. To sum up the code, I am using getline(cin,str_name... (by CJC0117)
by Steves
'main' identifier not found.
 
#include <iostream> #include <string> #include <cmath> #include <stdio.h> #include <stdlib.h> using namespace std; int firstadd,secondadd,initialsubamount, dedu...
[7 replies] Last: haha alright I just wanted to call functions in the midst of it. They ... (by Steves)
Try-catch block?
 
I made use of Java try-catch blocks a lot when I programmed in java, and now that I'm working on a c++ program, I want to make use of it as well. How can I use ...
[3 replies] Last: [quote=hopesfall]I was under the assumption that when I put something ... (by Wazzak)
[SOLVED] I moved sources then build fails
 
Hi all, I am new to Eclipse. I have started a project with the sources at the root. As my project grows, I decided to create a subdirectory src and I moved t...
[3 replies] Last: Eclipse for C++ is kind of buggy I've noticed. Works just fine for Jav... (by ResidentBiscuit)
vector assignment
 
I tried to read a text file into 2d vector but it keeps repeating the first row here is my code. any idea? #include "std_lib_facilities.h" #include <vector...
[2 replies] Last: it's much clear now. Thanks for your help. Now i can do the rest of th... (by ken2012)
Random access of vectors
 
Ok, so I'm trying to randomly assign names out of a vector storing these names. But, I believe my vector is larger than the number of actual elements I have bec...
[8 replies] Last: Oh wow, that fixed it. For some reason I thought size was giving me 1 ... (by ResidentBiscuit)
by skew
using const causes compiler errors
 
I have the following class class Test { public: void DoSomeStuff() { cout << "Doing some stuff ..." << endl; } }; Using the class like follo...
[3 replies] Last: Thanks!! (by skew)
[HELP] C++ Doubly linked list
 
i don't know how to create a double linked list. here are some code class Doubly_linked_list { public: Doubly_linked_list() { prevPtr=0; ne...
[no replies]
How to remove a character in string
 
How do you take the first character in a string, remove it, shifting the whole string down one spot, and then appending the character you removed to the end of ...
[5 replies] Last: Oh. I found it by accident. [ code ] Past code --- Output [ /code ]... (by histrungalot)
Insert things in the beginning of a vector
 
Hello. I am having trouble finding a good tutorial about how to insert a number in the beginning of a vector. Some say that I should use push_back(), however I ...
[14 replies] Last: Yeah...just read the reference... was to lazy to open a tab and search... (by shooninjo)
by rzgar
strlen - how to limit input
 
Hi when I use code without if..else terminal window closes and "send error rapport" window pops up (WinXP). how can I limit the input to only 10 char without us...
[4 replies] Last: thank you guys. appreciate your help. @Galik getline() solved the issu... (by rzgar)
by chipp
how typeid works?
 
i'm a little bit curious, how the typeid works? i mean, like, the syntax of typeid(variable).name(); is strange for me. can anybody explain it to me? and t...
[6 replies] Last: It's called Function Chaining . It's when you invoke a function from ... (by Wazzak)
Operator overloading.
 
I understand the basics of operator overloading and can make it work for the most part. However, I'm trying to do something I've only seen mentioned in passing....
[8 replies] Last: roberts I mean that using typdef for structs was useless. Instead of: ... (by LB)
text columns to rich text
 
Hello, I was wondering if it is possible to put text columns into rich text format? Input file: 1 A12 A15 A50 A73 A325 2 210 1200 24...
[2 replies] Last: thanx, i'll try something out (by sstrait)
How to Create & Store objects into a Vector dynamically (1,2)
 
"AFTER SOLVED" EDIT: This technique gives the ability to dynamicaly create an object each time and send it to a vector. By this way you wont any more have to ...
[25 replies] Last: Thanks you very much all of you. Solved. We've given answer to a vital... (by imakaia)
Passing arrays
 
I have a 3x3 array which I create and fill in one of my functions within my program. This function, lets call it makeMatrix(), is called from the main function ...
[3 replies] Last: http://www.cplusplus.com/doc/tutorial/functions2/ (by nooblet)
by PL285
Help with easy Project
 
Hello, I am pretty new to C++. I received a project today in which I am supposed to create a data file named ./current_inventory which will list about twenty ca...
[15 replies] Last: kapo, I am specifically confused on how to get the data table I have i... (by PL285)
January 2012 Pages: 1... 45678... 48
  Archived months: [dec2011] [feb2012]

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