General C++ Programming - March 2016 (Page 13)

by shalin
char to byte
 
Hi Guys, How to convert Char to byte in C++?
[4 replies] Last: thanqqq friends (by shalin)
by mkb555
Accessing a vector of nodes in a node
 
-------------
[3 replies] Last: `a' is a pointer, you need to derefence it to work with the object tha... (by ne555)
by Ferris
Reading data from a file
 
Hello! So I have a file created named "inputs.dat", and inside that file, I have coordinates entered exactly like this: 4 1 1 4 10 12 1.1 4.5 3 10.3 10 7 What...
[3 replies] Last: Hi, and is a keyword, means the same as && . There are a bunch of... (by TheIdeasMan)
What Compiler do you use?
 
-
[4 replies] Last: For IDE: QtCreator, KDevelop Qt is a large GUI frame work KDevelop ... (by TheIdeasMan)
Bubble sorting error
 
Hi! I am trying to sort an array with Bubble shorting technique. it works fine until last value. when last value is to be sorted it converts last value in to 0 ...
[1 reply] : you are stepping out of bounds. for(j=0;j<=4;j++) { if(arr >arr[j+... (by ne555)
Adding/Subtracting Limit
 
Hello ! I am new to C++ and I currently have a project that needs to calculate a number. My program needs to add and subtract numbers but reset it's counting wh...
[5 replies] Last: No problem, glad to help:D. (by McNo)
Trouble with std::out << std::string
 
Hi, The strangest thing: I am having the following code giving me compilation problems: std::string s{ "go" }; std::cout << s; I get: error C2679: bin...
[2 replies] Last: Got it, thanks!! (by JUAN DENT)
initialize a new pointer to an existing array
 
Please tell me how to initialize a new pointer to an array after the array has already been created: #include<iostream> #include<array> struct Card {...
[3 replies] Last: I thought that as well. This was a posted example of using a pointer t... (by technologist)
How to Implement List of Lists
 
So I'm trying to create a list of lists where basically in the main list, each node represents a line in a text file. Then in the sub-list, each node represents...
[3 replies] Last: I would recommend to make the nodes to have a list instead of a pointe... (by ne555)
by nvurdi
Should I use a map, 3D array, or stick with a stack?
 
So far I can get this to work perfectly for every case except when there are more open braces than closed braces. Whenever the stack still contains any open bra...
[1 reply] : what if: Instead of storing braces in vector, you should just count th... (by Gyiove)
casting char ptr to int ptr...big number output
 
Why my value for *p is a huge number? #include <iostream> #include <stdio.h> using namespace std; int main () { char *aChar; char aCChar=...
[3 replies] Last: Thanks, :) well I was looking at c code for printf but ya thought f u... (by csstudent123)
by KMagic
Removing records in the middle of the file
 
I have a binary file which contains a number of records. What is the best way to remove a record in the middle of the file? Eg: record 1 - record 2 - reco...
[1 reply] : One way to it is copy the remaining records to a new file, delete the ... (by Thomas1965)
Inheriting constructors
 
When we inherit base class constructors in a derived class using 'using' doesn't that inherit every copy and move operations from base to derived class along wi...
[2 replies] Last: Aye, aye. Got it. So copy/move constructors, copy/move assignments(fro... (by ajith mk)
Slicing problem when copying derived class
 
A pointer to a derived class implicitly converts to a pointer to its public base class. When applied to a copy operation, this simple and necessary rule leads t...
[no replies]
c++ A program that delete comments from fstream file
 
write a program that: a)if we encounter '//' we will ignore it and also ignore '\0'(end of the line) b)if we encounter /* we ignore all the chars untill w...
[no replies]
C++ for loop problem, last value negative Help
 
This program randomly generates a number between 1 to 10. These numbers will be added to 100, 200, 300 ... 1000. repesctively. The problem is that the last va...
[3 replies] Last: first loop starts at 0 and stops at 9 second loop starts at 1 and stop... (by ne555)
Professor's code not compiling (#include cannot find file in the same directory as main.cpp)
 
My professor gave us the solution to the assignment after we did it but I can't compile it (Running `g++ -std=c++11 main.cpp` I get error shown here: http://ima...
[15 replies] Last: Yup, turns out installing MinGW's 64-bit variant (the provider of this... (by immortal192)
Can someone help me?
 
I try to use function to find out how many negative numbers in three numbers, but I don't have any ideas. PLZ help me! this is what I wrote: #include <iostr...
[1 reply] : Instead of int howmanynegs (int x, int y, int z) try making a functi... (by McNo)
How do I count elements in a hash table?
 
Hello. I'm in a Data Structures class in a group of 3. My group members are rarely online to discuss anything, they just push and pull from git, so I can't real...
[no replies]
Constructing error_conditions does not work!!
 
Hi, I use MS Visual Studio 2015 and am trying to generate an error condition with value std::errc::invalid_argument . According to the header file system_e...
[4 replies] Last: Got it! You are absolutely right!! Thanks! (by JUAN DENT)
March 2016 Pages: 1... 1112131415... 23
  Archived months: [feb2016] [apr2016]

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