Beginners - April 2015 (Page 43)

Calling struct pointer method in main
 
struct Pool* createPool() { struct Pool* pool = malloc (sizeof (struct Pool)); // TODO pool->lock = uthread_sem_create(1); pool->count_from_empty = uthr...
[no replies]
How do you print each element from a stack?
 
Simple question I just need to know how to print each individual element from a stack
[4 replies] Last: Oh yeah that helped haha thanks! (by agamatr)
struct pointer
 
struct Pool { int items; uthread_sem_t lock; uthread_sem_t count_from_empty; uthread_sem_t count_from_full; }; struct Pool* createPool() { ...
[1 reply] : If you have an object, you use the dot operator (.) If you have a poin... (by Disch)
verify input is a character
 
Quick question. My problem is that when someone enters an integer or non valid char, the error statement "Invalid entry please try again" is printed and goes th...
[1 reply] : make answer of type std::string , then simply check if the string c... (by Smac89)
Issue with figuring out function to compare 2 arrays
 
Write a program that will store 7 integers (entered by the user) into an array called list1. Next, prompt the user for 5 integers and put them into an array cal...
[5 replies] Last: @TarikNeaj I guess you're right. I usually don't work with out of ... (by fg109)
by GilTea
Reading file and storing to a vector
 
Hi, I am trying to build a feature into my program that allows for information to be read from a text file and then stored into a corresponding vector. My p...
[1 reply] : hey, your code is trying to index a vector that has no elements which ... (by bazetwo)
How to write the operator new[] and operator delete[] here in the Class HeapTracked?
 
I came across this problem when I was reading More Effective C++. It's in Item 27. The class HeapTracked is used as a base class for the heap tracking function,...
[no replies]
Getting a missing semicolon error on a loop?
 
I'd say I'm about to scream but I've already screamed several times. I'm getting a syntax error for a missing semicolon before { on line 34. However... that's...
[6 replies] Last: Yes!! Thank you fg109. My program now breaks correctly and doesn't ask... (by violakat03)
Linked List Print
 
The program I'm currently writing uses a linked list. When the the program first starts, the current list needs to print 1 element with the value '0'. This happ...
[2 replies] Last: Thanks. I wasn't really thinking about the post conditions when attemp... (by thomaselder84)
Unable to create instance of class
 
Hi, I am having some difficulties when trying to create an object of a class. I have several classes. I have successfully created one using code like this: ...
[3 replies] Last: Hi, I have created an instance of the class however I am unable to p... (by PapaSmurf)
2D Array
 
I'm having trouble getting this 2 dimensional array to display as a pyramid, and i have no idea where to begin. #include <iostream> #include <fstream> #inclu...
[1 reply] : Please edit your post to use code tags - http://www.cplusplus.com/arti... (by TarikNeaj)
by deline
file reading
 
I'm trying to read a file in a very specific way and am having trouble finding a method I understand. I want to read each line of a very large text file writ...
[1 reply] : Nevermind, as soon as I posted this I thought of a way: string word;... (by deline)
I NEED HELP!! Payroll Array Program wont compile.
 
My Program won't compile and I've been struggling with this for about a day now I really need help. I don't know what to do. ERRORS: In function 'void Pro...
[5 replies] Last: I fixed it thank you! (by gamingYeah)
by Ksisky
Decimal Help
 
I am relatively new to C++ and I am building a calculator. I want to be able to add, subtract, multiply, and divide decimals but for some reason, I cannot. For ...
[2 replies] Last: Works great now! Thanks! (by Ksisky)
Some simple homework help
 
In this project, I'm supposed to have a FootballGame class that uses some objects created by a Referee class. I'm not entirely sure how to do this. #pragma ...
[1 reply] : I figured out that a try/catch block is what I'm supposed to do, rathe... (by McLovinmanDan)
Help with string to int
 
Any idea for the code for my getDigit function? I have to add on one digit at a time while in my loop. Dont know how to pick off one digit at a time. Is the fun...
[1 reply] : number would give you the character in the position `k' By the wa... (by ne555)
DllMain failing ?
 
Hey . I have problem with simple dll when i inject it with example cheat engine i got error "Failed to inject DLL " . I don't know why . #include <Window...
[no replies]
Operation of with the int age inside loop
 
It is a while loop inside of whom I want to do the average of the "int age" of the 5 "profile". I don't know how to calculate it. Thanks again! #include...
[1 reply] : Okay so, create a variable that will hold the average ages and set it ... (by TarikNeaj)
array question
 
This is incomplete program. My compiler show. invalid types 'int ' for array subscript. What does it means? I think i have something wrong with the input array...
[1 reply] : cin >> age ; illegal age is not an array also don't forget #includ... (by Yanson)
by GilTea
Issue with checking vector struct item is unique
 
Hi, I am trying to check to see if my id field is unique. I had the code working when it was just a vector but now that's being used as part of a struct its gi...
[3 replies] Last: My mistake, the 3rd parameter is supposed to be type char in this ca... (by fg109)
April 2015 Pages: 1... 4142434445... 52
  Archived months: [mar2015] [may2015]

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