Beginners - October 2017 (Page 2)

Need help with this code:
 
I have written this code to take 10 grades and average them, but the average is always like 75383571085315%. I have no idea why the number is so large and wrong...
[6 replies] Last: Oh, thanks for the advice everyone. I didn't realize i was trying to g... (by Wilshire)
Conversion of String into Two Dimensional Array
 
Hi everyone! I'm pretty new to coding so there's still much for me to learn. Recently I've been working on creating this battleship program that utilizes a two...
[4 replies] Last: What I meant was for "P1" to be shown on my two-dimensional (a ) gam... (by Jaybob66)
by glof2
SFML doesn't work...
 
I've got an error with dlls... I tried 64bit (it's on my PC) version but it had errors, and i couldn't run the program... I'm trying to do this in CodeBlocks ...
[2 replies] Last: I've downloaded 32 bit version. (by glof2)
Segmentation fault using struct
 
Seg fault after "Enter full Name line. Indicated below. #include <iostream> #include <string> using namespace std; struct student { int s...
[3 replies] Last: Undefined behaviour is undefined. Sometimes it can mean your program ... (by MikeyBoy)
turning 1.234 to 1234
 
hi,i need to turn a float number to integer with deleting its point sign. like this: 1.234 turns to 1234. i'm in need of your help for the condition that i sho...
[4 replies] Last: Thank you all for your answers. i used all of your advises to put them... (by Hospitr)
static vs constant in layman's language
 
Please tell me the difference between static and constant in easy language.
[5 replies] Last: thanks guys. (by closed account 1vf9z8AR)
Best way to manipulate texts using C++
 
How to manipulate texts using C++ like we do it using awk command in Unix
[5 replies] Last: There are many, more or less complicated ways to do it. Just try not t... (by benhart)
by ZhuZhu
Question: Get the difference for the largest and smallest number in a positive integer
 
Create a function to get the difference for the largest and smallest number in a positive number. For example integer 98721, the difference is 9 - 1, so the fun...
[3 replies] Last: #include <algorithm> unsigned int max_digit( unsigned int n ) { ... (by JLBorges)
by cash
how to delete index from array
 
I need to delete an index from the array, but mine is deleting a number rather than an array. else if (input == 6){ int index=0; int c...
[12 replies] Last: when using arrays (not vectors) you can't actually delete an entry, yo... (by Jaybob66)
Using external files
 
im reading from an external file. the program is suppose to be on bank transactions. I cannot seem to get passed one step. the file is dailytransactions.txt...
[3 replies] Last: [quote=neilram27]I cannot seem to get passed one step. [quote=Handy A... (by Enoizat)
CALCULATOR in c++ with implementation of OOP
 
It's my school assignment i have to implement c++ in OOP Urgent need to submit this morning :( calculator.h #ifndef CALCULATOR_H #define CALCULATOR_H clas...
[3 replies] Last: int Calculator::selectOption; should be int Calculator::selectOptio... (by Enoizat)
std::sort
 
my compiler doesnt like the way im doing std::vector and std::map for my sort is there any way to do it with just map std::vector< std::pair<std::string,stu...
[5 replies] Last: This looks a question for clairvoyants: how to guess what’s wrong in... (by Enoizat)
by vitcal
show data from txt file
 
Hello, i'm a really beginner in c++ code and i have a problem regarding the possibility to read a text file, display the values saved on the file directly on th...
[1 reply] : you will need to know the possible value ranges that the columns will ... (by Jaybob66)
help with printing user inputted arrays
 
I am writing a program where the user chooses a class size from one to twenty and user inputs the scores of that amount of test scores, then it prints out every...
[1 reply] : cout << "Original Scores: " << score << endl; score is effectively ... (by Repeater)
by Galtor
Problem with complex numbers
 
Hi all, I don't know how to solve the problem when compiling next code: in function 'void resfexact(std::vector<double>&, double, std::complex<double>&)': ...
[9 replies] Last: Ok, the code from @lastchance worked. Thanks a lot! (by Galtor)
Iteration to Recursion
 
I'm having trouble with iteration to recursion. I looked at many forums and articles (including the one on this site) about recursion, but I just don't really u...
[5 replies] Last: Line 3 creates an empty word. The word.size() is thus 0 and the loop n... (by keskiverto)
Writing inside Ncurses box
 
Hello, i'm trying to use Ncurses. Using the function box(win,0,0) i draw a box around a window. Btw, if i try to write a long string inside the windows...
[1 reply] : Any info on this? (by Amiplus)
by arbwok
Binary file not saving into same file
 
I can't seem to get my code to save the buffer into the same binary file. I read the file and placed it into a buffer, and after changing the values of the buff...
[3 replies] Last: fstream can be used for input-only or for output-only, or for both i... (by Chervil)
issue with linked list
 
#include "stdafx.h" #include <iostream> using namespace std; struct node { char myval; node* next; } ; int main() { node* h; node* n; node* t; ...
[1 reply] : What is the value of next? Write some code to print it's value by itse... (by TheIdeasMan)
Help I cannot figure how to start this.
 
Write a program to print the following table. Each row in the table has an integer, its square, its cube, and then its square root to 2 decimal places. Print ap...
[4 replies] Last: Thanks man for the help and I will format it better next time. I can't... (by mlass7886)
October 2017 Pages: 1234... 33
  Archived months: [sep2017] [nov2017]

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