Beginners - September 2014 (Page 9)

File Problems (Really Nooby Problem)
 
Okay so Im trying to learn how to write to a txt file and read it. I am still new to programming so I am a big noob :) However, I have come across a problem wit...
[4 replies] Last: Okay thanks I will change the names of the functions. I will come back... (by MasterGeek)
by Blue22
How to Calculate Algebra problems
 
I'm taking a computer science class that deals mostly with coding. I'm terrible at stuff like this but it's a graduation requirement (even though my major has n...
[11 replies] Last: One lots of small things ..... const double k = 6.67e-11; // doubl... (by TheIdeasMan)
Code is outputting the wrong values
 
Whenever I run my code it's outputting strange values for the number of values in CS 250. while(in_file){ //Output the line co...
[5 replies] Last: Post the smallest complete program that illustrates your problem, one ... (by jlb)
by hhhr
Find the last line and word in a file
 
Im trying to find the last line in a file and the last word in the line. if the last word has space . or , after it i have to get rid of it. This doesnt work ...
[1 reply] : Break into pieces: string wordfromline( string line ) { istringstre... (by keskiverto)
How do I get random swapping in arrays?
 
I'm trying to figure out how to randomly swap different elements in an array of structures, but I'm stuck. Wondering if anyone could help me out. This is wha...
[1 reply] : http://en.cppreference.com/w/cpp/algorithm/random_shuffle If you don't... (by MiiNiPaa)
chip game
 
Hey guys, my instructions where to write a chip game, which I have done. Except, I have one issue with my code. It starts off with Player 2, and after it has as...
[no replies]
by davez
problem with array (1,2)
 
is it possible to declare a two dimensional array that stores a name and grade because the data type of name is string and the data type of grade is int so ...
[21 replies] Last: multidimensional array is not like: int array1[ size ]; // size is... (by Gadamatik)
Validity of struct statement.
 
Is the below statement valid or invalid. Explain answer in either case. classList .pID = 000011100;
[10 replies] Last: that is what was stored in classList .pID. pID contains int. int is a... (by MiiNiPaa)
by mimi7
C++ Diamond pattern output
 
Hey you all. Does any of you know how to solve the code below to make a diamond pattern output? I just need help on the 'if' condition.Thanks in advance! #inc...
[4 replies] Last: Code tags, please. You almost get there: if ( ( (abs(x-3) < y) && (x... (by keskiverto)
Multiplying two arrays
 
I'm trying to multiply two arrays they are set up number{......0,0,0,0,1,2,3} , number2 {.......0,0,0,0,0,1,2,3} , and ans is filled with zeros, but I get a...
[3 replies] Last: I am starting at the end because the numbers in the arrays are at the ... (by mtbrooks1993)
Cin problem
 
I'm trying to make a simple program that asks 2 users for their name and age and then does a simple calculation to see who is older and then says "user x is old...
[4 replies] Last: Okay, thanks. I won't edit the code. I thought I needed to use the ==... (by UnclePutin)
cin is giving me an infinite loop
 
Hello, super new c++ programmer here. I am trying to make a program that allows uses to input movies and then format them to a list. However when a user inputs ...
[3 replies] Last: Ahh I see now, I figured it had something to do with the cin value. So... (by solaire)
problem with encription program
 
hello i have a problem with encripting a string. the encription method is called hill cipher the functions ToNum and ToChar are excluded because they just co...
[no replies]
Random crashes
 
The code is supposed to take two matrices from txt files, multiply them and display the result, it works but most of the time it crashes after displaying the re...
[3 replies] Last: Thanks guys, I solved it. Should I post the solved version of the code... (by closed account y0XSE3v7)
by rink15
function error.
 
Write your question here. I have just started learning C++ .This is my first function ,I am not sure what i am doing wrong that i am getting wrong answer.Pleas...
[2 replies] Last: Thanks Sir, really appreciate your help .I spent almost two hour to fi... (by rink15)
Don't understand how the code is working.
 
Input and Output Input to your program will consist of a series of lines, each line containing multiple words (at least one). A ``word'' is defined as a co...
[4 replies] Last: When it sees a letter at line 15 it is at the beginning of a word and ... (by dhayden)
Running a loop for input
 
I am attempting to write some code that will run in a loop each time the input is specified numbers (or other characters). As I'm sure you can see from the cod...
[12 replies] Last: Oh yes, I completely forgot. Thanks again. I rearranged some things ... (by Ascendant78)
The assignment operator in C++
 
I'm studying the C++ programming language and I'm reading the chapter about assignment operator ( = ). In C++ initalization and assignment are operation so simi...
[6 replies] Last: Perhaps code will be illustrative? #include <iostream> struct A { ... (by cire)
if statements issue
 
hello everyone. I'm fairly new to c++ and im doing a foundation degree in computing and software development and i am really enjoying the course. We are now ...
[3 replies] Last: Ah I think I see were I went wrong the second varieble should have bee... (by mochate)
Top-level const and Low-level const
 
Hello, I am working through the C++ Primer book and have come upon the code snippet that I have pasted below. Specifically this is dealing with const as it rela...
[2 replies] Last: Thank you for your answer! I don't know if this forum gives you credit... (by haydnguy)
September 2014 Pages: 1... 7891011... 51
  Archived months: [aug2014] [oct2014]

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