Beginners - November 2014 (Page 45)

by dcneo
saving random value from main to a function array
 
so this is what i'm suppose to do but its got me kinda confused, and my program just crashed any help would be appreciated:) Write a function that dynamically ...
[2 replies] Last: um not sure that really does what i need. thx tho. @JLBorges (by dcneo)
Why can't I declare class objects right after I make the class?
 
The header file below is what I am using for another file, but I'm a little bit confused about why I can't declare class objects right after I define a class. ...
[2 replies] Last: Because your constructor takes an argument. There is no Car() there i... (by mobotus)
Tad confused on constants.
 
I have a text file with a format like this. 3 6 X X X O O O O X X O O O X X X X X X The first two numbers are the size of a two dimensional array. Since I ne...
[4 replies] Last: For it to be constant, the value has to be known at compile time. The... (by Disch)
Help with arrays and functions
 
Hi, I'm new to this and am supposed to write a program that will grade a test with a percent grade with fifteen questions with the answers: 1. A 2. B 3. C ...
[4 replies] Last: If you have 15 questions then your loop would count to 15 not 10? Rem... (by closed account 48T7M4Gy)
Reading data from .txt to a struct vector
 
Hello, first post here, but frequenter of the forum... I need to open a file that has 3 pieces of data on each line, with an unknown number of lines. Here is...
[7 replies] Last: Protip: Put indented raw text (such as your assignments) in [ output]... (by Crazyglue)
by iluv41
control may reach end of non void function
 
I am getting the error control may reach end of non void function, but i cannot figure out why. This is what i have bool operator == (const MyNum& x, const...
[2 replies] Last: i still get that error after removing both else ifs. I dont understa... (by iluv41)
I/O question
 
Ok simple question I hope. I read your tutorial on I/O streams and just had a couple questions between --> http://www.cplusplus.com/doc/tutorial/files/ if (...
[4 replies] Last: I guess what I am cunfused on is how they both return false. do they j... (by smokebaca)
not printing out a few statements for the output
 
i want the output be like: 5 total 3 invalid 2 valid at the end but it doesnt print the invalid or valid and total prints out after every run instead of...
[11 replies] Last: By the way if (x < 0 || x > 300) { cout << "The group is ... (by giblit)
circular shift
 
I'm trying to write a function that will shift letters in a string a given number of spaces to the left, moving letters that fall off the end to the front. In m...
[1 reply] : offset = x % stringSize Then if you are shifting left you would take ... (by giblit)
trying to shuffle a string
 
I'm trying to write a program that will randomly shuffle a string input by the user. At the moment it's outputting some garbage. Here's what I have so far: ...
[13 replies] Last: Thank you. I got'er working. (by dunnDolphin)
have no idea what to make the class return if a test fails
 
i have two ciphers written,both of which require a key. now there is a catch here the key,and the number of letters in the alphabet( either 26,30,40) must be co...
[6 replies] Last: alright i get it now. thank you for your help (by DAoliHVAR)
Handling Large Data File
 
I am working on a project in which I have to sort and handle statics about football players. I'm not sure how to bring in the data. It will have to be sorted an...
[1 reply] : See tutorial about classes and structs (by Silvestar)
reverse a string in an array
 
I have to write a program that takes a user input and prints it out backwards. i need to use an array, and if someone inputs hello the output needs to say olleh...
[7 replies] Last: http://www.learncpp.com/cpp-tutorial/42-global-variables/ (by mobotus)
Bubble sort
 
Hello. I'm trying to sort a 2D matrix of random letters from least to greatest. (A-Z) I'm making a 1D matrix to sort it, but for some reason it keeps sorting fr...
[3 replies] Last: I'm pretty sure that bubble sort checks j-th and j+1-th member of an a... (by Silvestar)
Bubble sort
 
Hello. I'm trying to sort a 2D matrix of random letters from least to greatest. (A-Z) I'm making a 1D matrix to sort it, but for some reason it keeps sorting fr...
[3 replies] Last: wow thank you so much!!! (by RocketGrunt)
by wolfv
Two libraries have same file name
 
It could happen that two independent libraries have two identical file names. The following example is like that. The file names C.cpp and C.h appear in both ...
[7 replies] Last: OK, I see it now. Including both "lib1/C.h" and "lib2/C.h" made the c... (by wolfv)
How to work with data read in via loop using multiple functions
 
I am in the design stage of a program and must be missing the boat on something fundamental. I am hoping someone can help identify where I am going wrong in my ...
[4 replies] Last: Thank you very much!! (by elliott22)
Classes example - simple
 
Hi, I'm very new to classes. Sorry if my technical explanation for what I'm trying to do is a bit off. I'm trying to make my program work by putting in the ...
[7 replies] Last: I got it now - thank you for helping me out! (by project science)
Putting words from a string into its own individual strings
 
So for an assignment I need to some how get "num_lines" and "logfile.txt" into its own individual strings. An idea I had involved individually checking each cha...
[3 replies] Last: Ok, using string facilities: #include <iostream> #include <string> #i... (by MiiNiPaa)
Identifier is undefined
 
Hi guys, am doing my first programming assignment for uni and having trouble understanding why originalNumber is not recognized at line 24/25/26, if anybody cou...
[1 reply] : Check the spelling of the variable on lines 25 and 26. I'd put functi... (by wildblue)
November 2014 Pages: 1... 4344454647... 65
  Archived months: [oct2014] [dec2014]

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