Beginners - November 2017 (Page 31)

loading function more efficiency and other minor issues
 
I created this fake loading function just so my program looks more cool to the examiner but the thing is i want the previous loading to disappear. for exampl...
[5 replies] Last: Oops, I meant the screen I'll edit and adjust. Meanwhile other answers... (by knowclue)
how to read 'enter key being pressed'
 
I want my std::getline(std::cin,line,'.') to work in such a way that instead of a dot a simple enter key being pressed ends the user input and reads t...
[1 reply] : ... simple enter key being pressed ends the user input use the no... (by gunnerfunner)
Pointer saving one element only
 
I'm trying to make a program that allows the user to display a list of students with a specified gender. It asks the user to enter the gender and this function ...
[1 reply] : You have 2 choices. You can create a new list with all the values fou... (by jonnin)
by jvlinh
Simple substitution?
 
My assignment was to getline from a file then match to an array of chars to replace with another array of chars. I already did the same with spaces. c...
[3 replies] Last: #include <iostream> #include <string> #include <fstream> #include <ca... (by JLBorges)
need help checking my code; thank:)
 
I know this is supposed to be a c++ programming website, but i would really appreciate if someone would help me check this c programming code. thanks in advance...
[5 replies] Last: ok!! Thanks a lot mate! appreciate it! (by Limitless98)
by ericM
set up a const std::vector
 
I'd like to read some data (the number of elements is not known at compile time) from a file and store them in a vector. I also like the vector to be const, s...
[2 replies] Last: Something like this: #include <iostream> #include <vector> #include ... (by JLBorges)
Passing 2D Array to function
 
I'm trying to pass my 2D array matrix to the function findnorm() but I don't know how to set up the parameters. #include <iostream> using namespace std; c...
[2 replies] Last: Note: These two declarations are technically identical: int findnorm(... (by keskiverto)
Print nth element in linked list using recursion
 
Actually I was required to only print out every other element in a linked list using recursion but I am very curious if I can use recursion to print out nth ele...
[2 replies] Last: Keep count, if you need to count to n: void foo( N* p, int count ) { ... (by keskiverto)
How to output a string two letters at a time?
 
I am trying to read from a file that contains sentences and output them two letters at a time. IE: >hello world >how are toy Output: he ll o...
[5 replies] Last: #include <iostream> #include <string> #include <cctype> using namespa... (by lastchance)
Account Class C++
 
Any help is greatly appreciated, thank you Design a class named Account with Account.h (including class data fields and function prototype) and Account.cpp (...
[1 reply] : Just saying, the first object you make,and it's reference and pointer ... (by goldenchicken)
Static Keyword. (Doubt)
 
I Dont Understand this code. code:- #include<iostream> using namespace std; class sample { static int c; //declaring static c initialised to zero //...
[2 replies] Last: 4. It's less "should" and more "must". If you try to access a non-stat... (by helios)
maps
 
This a general question should we used nullptr with maps?
[11 replies] Last: it would be p = item.second;//FOR EXAMPLE I keep saying, get a... (by TheIdeasMan)
by Ch1156
Is there a better way to write this code?
 
I really want to start learning how to wield the string class and using it to make games and programs and stuff, but before i get too far, i created a small pro...
[10 replies] Last: Sorry for the late reply, thank you for your responses. I thought that... (by Ch1156)
Deleting element from array
 
My professor mentioned that she wanted it done so the element is removed from the array and the amount of elements decreases by one, instead of replacing the el...
[3 replies] Last: Pardon the ASCII art, but the idea is that you just shift the parts th... (by mbozzi)
Not compiling code, really long GDB error message.
 
Hello, I'm trying to debug this code but the GDB error is so long I'm having a hard time to decipher it, Vim doesn't seem to want to compile it with GCC and co...
[9 replies] Last: Note: Clang 5 emits the following warning: 01-191944.cxx:29:53: wa... (by mbozzi)
Need help putting spaces between every 4 bits
 
Hey, I finished most of my code I just need spaces between a group of four bits. Thanks' #include<iostream> #include<iomanip> #include<cmath> using name...
[1 reply] : Have you tried yourself yet? If not, first do that and when you're stu... (by goldenchicken)
NEED HELP WITH BASIC C++ PROGRAM
 
Hey there guys, just trying to figure out why my code is not working as it should. The end goal is for the user to be able to use -1 as a sentinel which will br...
[1 reply] : = is assignment == is comparison > why my code is not working as it s... (by ne555)
[NEED HELP] Something wrong with functions from fstream and "cout" them.
 
I just need to know how to solve my problem. The file is in french, but I will explain you. Just test this code and enter : 3 Whatever String Whatever Str...
[2 replies] Last: Thanks a lot Andy, you really helped me !!! Thanks for your time I app... (by PichDereck)
Having trouble passing array by reference
 
In my code, the user enters an array to whichever size they want (max 100). I'm trying to create a function insert() that allows the user to insert a new elemen...
[3 replies] Last: Hello alexa7707, On line 27 the first argument is sending the functio... (by Handy Andy)
linked list insertion at end
 
Help i am almost close to getting a perfect output.Want to insert new values at end of my list. #include<iostream> using namespace std; struct node {...
[3 replies] Last: Line 8: rear is wrong. You still need a pointer to the front of the ... (by AbstractionAnon)
November 2017 Pages: 1... 2930313233
  Archived months: [oct2017] [dec2017]

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