Beginners - March 2017 (Page 34)

char handeling...
 
So I was working on some kind function that can make a sentente into lot a word array. It compile fine, but I get some errors with it; #include <iostream> ...
[4 replies] Last: My code presume: 1 – you are not trying to write your own version of... (by Enoizat)
adding integers
 
when you add numbers, for example int a=5 int b=6 you also say int sum = a+b but why do you need to say int again for sum? it will already be int if i...
[5 replies] Last: there are a dozen types of integer as well (many redundant). say you... (by jonnin)
struct
 
Hello everyone! I have a question regarding the structure definition below: struct elem {int inf; elem *adr;} The matter isn't the program but my logic i...
[2 replies] Last: When declaring a pointer you don't need the full struct definition. It... (by Peter87)
populating array from while loop
 
hi, how can I populate a given array from while loop. and print out to screen? unsigned long long int ip; unsigned long long int delta = 1000...
[2 replies] Last: nice one! i forgot the for loop. :-) thanks again! (by csecs21)
by ggwp
c++ to pseudocode
 
Hi friends. Can anyone please help me to convert this coding into a pseudocode. I'm having trouble to convert it. please help me :) void admin() { st...
[2 replies] Last: Can anyone please help me to convert this coding into a pseudocode. ... (by TheIdeasMan)
by tit0n
Infix to Prefix
 
if I take this expression -> (1+((2+3)∗(4∗5))) it converts to this -> +**54+321 Anyone know a solution just based off my function here? I can p...
[1 reply] : Not really fancy but it works at least for the most parts. #include <... (by Mantorr22)
Newton's method
 
The goal is to use Newton's method in order find the zero of a function. So in the end I want my program to look somewhat like: f(x) f'(x) initial value clos...
[3 replies] Last: You should start slowly. First of all, test your function and its der... (by lastchance)
If Else and Assigning Values
 
I am trying to solve the below problem and was wondering if there was a way to assign a range for the variable names so that if a person were to type in the # o...
[1 reply] : $0.08 for each check if you write between 20-39 checks int wchec... (by closed account 48T7M4Gy)
by Bizzy
Bool Not Returning Value?
 
Hey, so this is embarrassing since this is an incredibly basic function I'm trying to write, but whenever I test it I don't get either true or false. I need the...
[4 replies] Last: whenever I test it I don't get either true or false What do you mea... (by xismn)
next function
 
My understanding for next(ptr,n) is it returns a pointer to the nth element after *ptr. My question is: Can n be negative? what happened to e.g. next(ptr,-2)...
[4 replies] Last: Yes, it is std::next(). Thanks. (by landlord2017)
assert C++ (Problem understanding the code)
 
I have problem understanding this code. I don't understand what is going on from assert code. void append(int x) { if (size >= capacity) { ...
[4 replies] Last: > Am I right with my logic ? Yes. assert(size < capacity); is equiv... (by JLBorges)
Class - dice_roll error
 
I'm getting error code - error: expected primary-expression before 'dice_roll' in my constructor. What am I doing wrong? Edited on 2/28/17 I've edited this cod...
[5 replies] Last: Got it! I finally realized that all of the variable names in the const... (by volTron)
Help with functions
 
Hi, Is there another way for me to properly terminate my rock, paper, scissors program other than using exit(1) in my int calculateWinner function? I tried ...
[6 replies] Last: Why is it not proper? Because it introduces a hidden control path t... (by mbozzi)
Problem displaying strings from a struct using a pointer
 
Im working on an assignment where the user can enter some inputs via a struct pointer and display them. My problem is when I hit option 3 (lines 94 to 102) to d...
[1 reply] : employeeRec *p, records ; I suspect you wanted records to be an arr... (by gunnerfunner)
Need Help With Input
 
Good evening all, I need some help fixing the readgraph function for my minimal spanning tree assignment. This function reads a copy and pasted format such as t...
[1 reply] : add this in a couple places and see what's going on. cout << "U:" << ... (by SamuelAdams)
by tit0n
Infix to prefix
 
Infix to prefix. I am trying to follow pseudo code with no luck Where am I going wrong? #include <iostream> #include <stack> #include <string> usin...
[1 reply] : I don't see any pseudo code here, what problem are you having ? (by SamuelAdams)
assert C++ (Problem understanding the code)
 
I have problem understanding this code. I don't understand what is going on from assert code. void append(int x) { if (size >= capacity) { ...
[no replies]
String - Out of range
 
When i delete the last character in the string I get the error "string is out of range". I understand why I get the error because when I press backslash theres ...
[4 replies] Last: Can you put your problem into a small stand-alone program involving ju... (by gunnerfunner)
Storing user input
 
Hi everyone, I'm trying to build a program where the user inputs a string that has an int, and a char. I'm trying to store the int in a register given by t...
[2 replies] Last: #include <iostream> #include <string> #include <cctype> #include <ss... (by gunnerfunner)
I need some help with this mobile service provider program
 
Here is the assignment: Mobile Service Provider A mobile phone service provider has three different subscription packages for its customers: Package A: F...
[no replies]
March 2017 Pages: 1... 3233343536
  Archived months: [feb2017] [apr2017]

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