Beginners - March 2016 (Page 7)

pointer to char not working
 
I want to print the txt ="abcd". However, it doesnot work. I am not good in pointer understanding. Would anyone kind to guide me in this regard? void f(cha...
[4 replies] Last: Thanks keskiverto, yes you're right. (by Chervil)
link: is not a member of node <T>
 
We are working on linked lists in our Data Structures class, and our instructor gave us this code to try in our compiler and it's not working for some reason! I...
[4 replies] Last: I'm sorry yes I just meant I am adding link to the struct I didn't... (by Outlaw782)
Dividing and Multiplying a Double yields different results
 
I have this little tutorial program I am playing with in C++ with QT. It converts 2 currencies at once based on user input. And it keeps all three of them sy...
[4 replies] Last: Thanks. That sounds like a good solution (by justcolorado)
Search and replace in text file
 
I'm trying to search and replace in a text file but it isn't working, I know its simple feel like im missing something small. I'm trying to replace Electric wit...
[3 replies] Last: That code is very hard to read - single letter names such as 's' are d... (by Chervil)
by ni0bi
input string and randomize the string
 
Hey whats up?? I need some help I am trying to change this code but having issues on the correct way to take the input of a string and rearrange the letters(...
[1 reply] : You are passing to the function mixup by value , so it is working on ... (by Moschops)
Updating Function parameter. (Classes)
 
I have to demonstrate the class in a program that creates a Car object, and then calls the accelerate function five times. My question is how do I get the p...
[6 replies] Last: Thanks for all the help! You guys! (by plsalinas)
How do you simulate a tree adt using a linked list?
 
My professor never explained to the class how to create one and the slides and textbook are hard to understand.
[1 reply] : He said there should be a class for Node, a class for position, incorp... (by DoABarrelRoll94)
by cybop
HELP!!!
 
I am new to C++. I am currently taking intro to C++ and was given the assignment below. The code I wrote does not even make it through the While loop...what I a...
[4 replies] Last: Thank you guys for your input, but this hasn't helped. I will find ano... (by cybop)
Problem with converting from infix to postfix notation
 
The program works fine when I input an expression without parentheses but not when I include parentheses. #include <iostream> #include <sstream> #inclu...
[6 replies] Last: I just changed the prcd function. I don't know why but when I was retu... (by DoABarrelRoll94)
by jcmd
project using while loops
 
This whole project i have to create is "A high-end coffee shop has just hired you as their senior programmer. They have tasked you to design and implement two ...
[1 reply] : One problem is that you need to initialize cost to zero before you sta... (by koothkeeper)
Modifying a program to take input data.
 
I have been tinkering around with this problem for the better part of an hour and after having looked everywhere I'm not sure what to do. Any help would be gre...
[1 reply] : Shouldn't your input file contain the answers the user gave when you r... (by koothkeeper)
How to reverse a sequence
 
Hello everybody, sorry for my english, I'm french. I'm also a beginner in C++ I have a question. I need to reverse a sequence of letters In one octet, there ...
[2 replies] Last: You could make an Octet class or struct: #include <iostream> #includ... (by xismn)
Rand() function and dynamic memory for Battleship.
 
I was working on a one player battleship game where the computer will randomly place the amount of ships that the player requests on the board, randomly. H...
[1 reply] : You need to initialize the random generator. http://www.cplusplus.com/... (by Thomas1965)
by jcmd
Adding while using for-loop
 
So I'm a first timer using this website, and first time using C++ or doing any programming. I am stuck with this assignment "Write a program that prompts the us...
[2 replies] Last: Thank you (by jcmd)
by asya
Alarm clock multiple issues
 
Hello, I have an alarm clock assignment. I tried for days, but I don't ave enough knowledge to make it. Here is a part of the assignment: Include 2 construct...
[no replies]
by asya
Count number of letters in a word from a file
 
Hello, I need to make a program that reads each word from a file and replaces the word with the number of its letters and prints it in an output file. The pro...
[3 replies] Last: Thank you. When I added "if (count > 0)" everything worked right. (by asya)
Averages from a file
 
Really Stumped!!! Not even sure where to start this is my first attempt at something like this and little info from the videos for a program like this. Here are...
[16 replies] Last: Aha! Great help ther must close. I am doing an online class with no in... (by miah612000)
How do you calculate the sum of arrays?
 
I'm new to C++ language. I would like to random generate 5 numbers (between 0 and 50) and then calculate their sum. Could I see an example of this? I know ab...
[3 replies] Last: > which is more generic than the sum() above It is not a wee bit more... (by JLBorges)
Insert into 3D vector
 
How do I insert a number into a certain index of a 3D vector? ifstream database("file.txt"); string line; vector<int> C(0, 0); vector< vector<...
[3 replies] Last: Oh, I figure out myself!! M.push_back(vector <vector<int> >()); An... (by tomtran3110)
Why does this program output 2 x the typed in characters?
 
It outputs http://s28.postimg.org/52zudak7x/Untitled.jpg #include <stdio.h> #include <conio.h> int main(void) { char ch; printf("Type in characters (Press E...
[1 reply] : Each character shows once when you type it in, and once when line 10 o... (by Moschops)
March 2016 Pages: 1... 56789... 47
  Archived months: [feb2016] [apr2016]

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