General C++ Programming - January 2016

Linear Search
 
#include <iostream> using namespace std; int search() { int i, num; int a = {12, 18, 95, 3, 16, 1, 16, 25, 30, 45, 19, 89, 99, 32}; cin >> num; f...
[5 replies] Last: Got it! Thanks guys! It's an assignment due tonight for my Data Struct... (by WakeofMisery)
string parsing issue (1,2)
 
I have following null terminated char array which I want to parse as follows: look for the first '\n' and then look for the '^' after this pack the ascii chars ...
[35 replies] Last: thanks a lot Chervil everything is working fine now. I learned a lot f... (by aliyesami)
Function
 
Function that generate a pointer type like node<itemtype>*getNext() what is this actually ?i having confusion
[4 replies] Last: Yes. (by dhayden)
Reading data from .txt file
 
I am supposed to do a program that reads the data from the notepad. the inside of the notepad is something like this 2012-01-01 Rain 7 13 0.28 2012-01-02 Sc...
[5 replies] Last: Please edit your post and add code tags. I know how to make a code ... (by jlb)
I/O advice request
 
Hello everybody, I'm working on a program that reads from a file a sequence of numbers and push them into a stack. I give the file name that containn the numbe...
[5 replies] Last: Thanks again, but it gives me this error: You must be using an older... (by cire)
by Won
Lottery number checker
 
Hi! I would like to write a program that can check whether my tipps are winning or not. There's a file containing the winning numbers and another with my tipp...
[1 reply] : Could you post your code, or at least a small extract of the code that... (by Shadowwolf)
THIS CODE WONT READ TEXT DATA TO 2D VECTOR. HELP TO EDIT
 
I created a text file using a 2D string vector. It contains data arranged as here below. I want to read the whole text file. LR UNIT NUMBER: RTI3866996...
[6 replies] Last: TheIdeasMan, then to receive user input one would implement the vecto... (by Mwangi Elijah)
How to make admno unique in prog. with FILES ? Code is here below.
 
#include <iostream> #include<string.h> #include<fstream> #include<conio.h> #include<iomanip> using namespace std; class student{ char admno ; char name...
[1 reply] : One way would be to keep all the students in a vector. Before you add ... (by Thomas1965)
Products Inventory
 
The output of the quantity in my updated inventory is wrong. Here's the code: #include<stdio.h> #include<conio.h> struct product{ int Q; char C ,...
[1 reply] : Sample Run: How many products: 3 Product Code: PN Product Name: Pen... (by casescs)
lambda with auto&&?
 
Hi, I found this code in a book: auto funcInvocation = (auto&& func, auto&&...params) { std::forward<decltype(func)>(func) (std::forward<...
[3 replies] Last: > the value of func is probably the address of the function to be call... (by JLBorges)
Vertical Bar Graph
 
I have an upcoming lab assignment that I am trying to get an early start on, but I am having trouble finding help on the Internet. Basically, the assignment is ...
[3 replies] Last: I tried, but this site has been giving me problems. I kept using the c... (by Dragonov)
Using file stream
 
Hi all, I wrote this little piece of code in order to read the content of a text file. I expected to see the variable "test" equal to the whole first line of ...
[4 replies] Last: Here is the code I am using now. After line 9 I still have the console... (by neljunior000)
Need help with display
 
Hi i am having trouble figuring out why it doesn't show my display when I run my program can somebody point me in the right direction of what I'm doing wrong? ...
[3 replies] Last: In the function float getActualLiving() the closing curly brace is mis... (by Thomas1965)
Different destruction depending on how shared_ptr is created
 
Hi, I have the following: struct Widget { ~Widget() { cout << "~Widget: " << this << endl; } void operator delete(void*p) { cout << "...
[2 replies] Last: got it, thanks!! (by JUAN DENT)
Return thread_local to main thread
 
I'm creating a coin-toss program where multiple coins are flipped using separate threads (one coin per thread) and the results are printed by the main thread. B...
[5 replies] Last: > if he wants to run this in several different threads then how can h... (by JLBorges)
Need help
 
hello guys , ive been trying for quite long so please if anyone can help i really need it here's the question : Create a class called Date that includes...
[1 reply] : I would do it like this: #include <iostream> using namespace std; c... (by Thomas1965)
Receive Only Http Response Body
 
I have the following code which works perfectly to fetch a url for me: #include <winsock2.h> #include <windows.h> #include <iostream> #include <string> //#pr...
[no replies]
by souvik
controlling power output from pc
 
Hello buddies..i want to learn and attain knowledge about that is there any way so that we can control the power output from the pc??...literally saying that is...
[no replies]
Having problem in program with FILES. Pls reply ASAP.
 
#include <iostream> #include<string.h> #include<fstream> #include<conio.h> using namespace std; class student{ char admno ; char name ; char stbno ; ...
[9 replies] Last: Post your current code. (by jlb)
Mouse Program,Error
 
The output is disjoint...i dunno why? plz comment #include <iostream.h> #include <graphics.h> #include <dos.h> union REGS in,out; void showMouse()...
[5 replies] Last: moschops and chervil ty (by Frooster)
January 2016 Pages: 123... 18
  Archived months: [dec2015] [feb2016]

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