Beginners - October 2019

Overwriting the same node when loading file
 
I'm working on a project for class, and I was having problems with memory errors (fixed it, deleted my post). I'm no longer getting exceptions thrown from that,...
[7 replies] Last: Ah, I see, thank you for explaining. I was actually following an examp... (by FeedMeTacos)
Want to prevent a duplication of a header file.
 
How can I prevent the duplication of stdlib.h in main.cpp? // AllocateVector.h #ifndef ALLOCATEVECTOR_H #define ALLOCATEVECTOR_H #include <stdlib.h> ...
[9 replies] Last: I am sorry for him. (by shafiul0304034)
Else without a previous if
 
Hello. I meet a problem in my code(fragment of a code): if(calitate == 0.065 && esantion_dublu < 500) A1 = 0; R1 = 1; A2 = 0; R2 = 1; else ...
[5 replies] Last: Directly comparing floating-point values for equality is very error ... (by Ganado)
by cash
sorted insert
 
I need to insert a node into a sorted link list, but I'm getting errors. Can someone help with whats wrong? struct NodeType { ItemType value; No...
[2 replies] Last: You can handle both special cases that salem c brings up by using a po... (by dhayden)
Equation program
 
Hello I'm begginer in C++, and I need to make a program to calculate this equation. Can anybody help me? A and M reads from the keyboard Equation: https://pos...
[5 replies] Last: if k is small you can just do a simple loop where you grow factorial r... (by jonnin)
Accepting Hyphens in String
 
Hello, I'm a student just beginning to learn C++. My current task is to write code which will accept a user's first, middle, and last names, as well as various...
[7 replies] Last: Thank you, I've figured it all out. You've helped me realize that whe... (by willsmek77)
deadlock with mutex lock
 
please tell me how to execute this piece ofcode epthread mutex t first mutex; pthread mutex t second mutex; pthread mutex init(&first mutex,NULL); pthread...
[2 replies] Last: actually i dont know which library i should include in this code (by arslanjafer)
creating operating system
 
Start here: https://wiki.osdev.org/Expanded_Main_Page Good luck :)
[1 reply] : Looks like a doublepost of http://www.cplusplus.com/forum/general/2647... (by keskiverto)
Suggested improvement to C++ Language Tutorial
 
I have not used C++ for many years and I am following your tutorial to refresh and update my knowledge. The Pointers section explains * and & prefixes, but doe...
[6 replies] Last: a reference is LIKE a pointer in many ways, but is not a pointer. ... (by Repeater)
Building a Logic!
 
What's Logic Behind this sequence 1, 11, 21, 1211, 111221, 312211, 13112221, 1113213211.... !? I have to print it using loops. But not comming up with logic ? ...
[4 replies] Last: Yes, @Ganado! #include <iostream> #include <string> using namespace ... (by lastchance)
Can't seem to call string in instance
 
I am very new to C++, I have been struggling with functions calling from classes. I have been working on a very basic calendar program and for every error I fix...
[3 replies] Last: #include <iostream> #include <string> using namespace std; class dat... (by lastchance)
Problem about class constructor
 
When the class constructor called another class constructor, the value of the a,b,c is not changed by the new called class constructor. I wonder why the new co...
[2 replies] Last: Thanks for your helping!! (by miku831)
C++ array issue
 
I know I'm overlooking something trying to build this mad lib simple but my array is starting at the wrong spot or skipping. You can input this code online to...
[1 reply] : Why are you dynamically allocating your array? You can just do const ... (by Ganado)
Did you guys see any mistake from this small code!
 
Write your question here. For some purpose, i need to use malloc() function to allocate a 2D array. After implementation I want to re-check this small ...
[14 replies] Last: ok Sir. (by shafiul0304034)
error in do...while, help
 
#include <iostream> using namespace std; int main() { int s; int sks1,sks2,sks3,sks4,sks5,sks6,sks7,sks8,sks9,sks10; int tsks1,tsks2,tsks3,t...
[2 replies] Last: 1. You should have made case 1 work first, before copy/pasting the sam... (by salem c)
Some of C functions do not work in C++
 
Hello, I have next code in main.cpp: #include <iostream> #include <stdio.h> void main(void) {cout <<"XXX"; printf("YYY"); } I received: error: invalid p...
[3 replies] Last: Keskiverto has already shown you how to do that. If there are things ... (by MikeyBoy)
HOW to change value of a number present in a string
 
string: this is a 79 pc output that i want: this is a 200 pc
[1 reply] : echo "this is a 79 pc" | sed s/79/200/ That, obviously, is not C++ b... (by keskiverto)
by Bopaki
Asking for help about correctly writing this constructor
 
In the baseClass there is only the default constructor binaryTreeType(); //default constructor template <class elemType> binaryTreeType<elemType>...
[2 replies] Last: hint: a constructor is called when an object is constructed do you not... (by ne555)
last pair in my input file printing twice.
 
I have made a program that overloads operators effecting rational numbers including input and output. it reduces to lowest form, moves negatives to the correct...
[4 replies] Last: The first read will either read something or set the "eof" bit. What... (by jlb)
create my own main function
 
I would like to understand how the main function works with argument argc and argv. So I try and create my own but it doesn't works. int myownmain ( in...
[4 replies] Last: #include <iostream> using namespace std; namespace myspace { int... (by lastchance)
October 2019 Pages: 123... 18
  Archived months: [sep2019] [nov2019]

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