General C++ Programming - October 2014 (Page 27)

by sebz92
copy doubly linked list
 
so i have a doubly linked list and i want to copy it. how do i do that?? struct node{ string data; node* next; node* prev; }; struct list{ ...
[no replies]
Delete function not working
 
Hello, I am having issues making my delete function work. My program does compile but my delete function doesn't work any help would be appreciated. I haven't f...
[2 replies] Last: note #include <conio.h> errors on cpp.sh. site doesn't have the libr... (by closed account 1CfG1hU5)
why can't I use getline(cin, argument) with fprintf("%s", argument)??
 
Instead of coming out as the character string I entered. It's outputting random European letters and symbols. I can't continue working on the program without...
[5 replies] Last: Hi, you can't use fprintf(fp, "%s", str) to output a string object d... (by comradejonathan)
Friend functions - variable out of scope
 
I'm trying out friend functions not in just one source file to see how it works but I'm getting an error. /* ----- ClassOne.h ----- */ #ifndef CLASSONE_H...
[3 replies] Last: It depends on how you want to go about it. Because they both depend on... (by Ispil)
User Input in italics
 
Hello! I am a beginner in C++.The program I want to create is as follows. The program will take a sentence as input from the user in italics and display it....
[6 replies] Last: You code should work. What else to resolve? (by liuyang)
reading from stdin
 
Hi I want to read a string of unknown length from stdin. I tried to follow the approach from this link. http://www.cplusplus.com/reference/string/string/...
[5 replies] Last: ...The policeman pointed out that the sign indicated they were drivin... (by Duthomhas)
how to FIELDS OF WIDTH and format decimal place
 
#include <iostream> #include <iomanip> using namespace std; int main() { float f,c; cout<< "Fahrenheit\tCentigrade" <<endl; for(f=-50; f<=300; f=f+10){ c...
[no replies]
Dynamically Allocated Arrays with Structs
 
I am trying to complete this lab assignment by following the instructions provided in the comments. There is one instruction that I do not understand. In the fu...
[no replies]
How do I flush scanf buffer in C?
 
Hello! I am writing a program and am asking the user to enter a number between 1-12. If they do not, they will be promoted over and over again to enter a nu...
[2 replies] Last: The scanf() function will not read anything that does not conform to... (by Duthomhas)
Is there any way to shorten this?
 
I am a beginner C++ programmer. I have just written a program for Tic-Tac-Toe, and this is by far the most complex program I have written so far. It works fine ...
[1 reply] : Your victory condition and turn logic are too long. Simplify them. Ma... (by MiiNiPaa)
How to read a line with Spaces in c++ ?
 
I want to store the address of a customer (with spaces) in a char variable (say cadd). First I tried to use "cin", as we know it reads until it sees any whitesp...
[3 replies] Last: You need to add cin.clear() and cin.ignore() before using another getl... (by rai2412)
SF2 soundfont and volume panning?
 
...
[no replies]
Is it possalbe to check all files
 
Alright so i already have a program that will take a person's name and age , along with their address and place it into a txt document every time its a new pers...
[3 replies] Last: Enumerating the files on a system is mostly a function of the OS that ... (by Computergeek01)
Lost Refference ?
 
#include <stdio.h> int *bar(int *p) { return p; } int* foo(int n) { return bar(&n); } int main() { int *p1 = foo(1); int *p2 = foo(2); pri...
[5 replies] Last: Yes, getting a "nice", repeatable output from undefined behaviour wit... (by JLBorges)
by Ndrewm
Pseudocode Construct
 
Can anyone give me construct a pseudocode for this program want to be able to better understand the processes and functions require to write the code. Its about...
[10 replies] Last: Yea your input is fine i just transfer it to my format so please finis... (by Ndrewm)
by AceK
what does this symbol ' ^ ' represent in C++
 
Hi everyone. I recently came across C++ code that use this ^ to declare variables. Please see example code below. private: System::Windows::Forms::Button^ Bu...
[11 replies] Last: Operators (such as ^) can have different meanings in different context... (by coder777)
Increasing variable number in C Files
 
Im having trouble on getting the quantity up of the variable "item.iqty". For example the current quantity is 5 and in this function, the user inputs a number a...
[3 replies] Last: Why? The first read is redundant. I think you should print the value... (by kbw)
by hp16
Singly Linked List - Delete duplicate nodes
 
I don't know why my code is not working. Can someone tell me what I did wrong? It's from line 249 - 266 void SLL::deleteDuplicate(){ ...
[1 reply] : That algorithm is pretty confusing. I just don't understand why all t... (by kbw)
[HELP] Programming problem
 
Hello! I have a programming assignment due later in the week and my professor is very cryptic with his responses so asking him for help is detrimental to my lea...
[5 replies] Last: Simply iterate over the vector, and check the value of each element. ... (by MikeyBoy)
Factors and Prime Numbers
 
I'm trying to write a program that will find all the factors and primes for a range of numbers. I have the inner loop working but I am having trouble writing t...
[7 replies] Last: http://www.cplusplus.com/forum/beginner/144496/ (by closed account 48T7M4Gy)
October 2014 Pages: 1... 2526272829... 38
  Archived months: [sep2014] [nov2014]

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