Beginners - October 2014 (Page 18)

struct vs array
 
what is the use of struct if i can just use array rather than creating object of a struct again and again
[9 replies] Last: I think you're missing that you can also have an array of structs. St... (by AbstractionAnon)
How to print special keys
 
Hi, I'm using visual studio and can't seem to print and repeat alt 205 several times on the screen. I have this line of code and getting an error on cout:...
[1 reply] : You don't need the assignment "=" or the \ string s ( 20, '=' ); or ... (by PCrumley48)
prompt the user to rerun the program
 
I completed this program, but I want to promt the user to re run the program by pressing y or n for yes or no This is what I have so far, but the part at the...
[4 replies] Last: Yup - if answer is char; if answer is string, double quotes. I someti... (by PCrumley48)
Message encoder malfunction
 
I am attempting to make a program that will encode (or scramble) a message that can be decoded by the same program. I am entering a string which will have ever...
[1 reply] : The statements in the function are getting run in sequential order, so... (by wildblue)
What is a pointer notation?
 
Write your question here. I am wondering what a pointer notation is in C++. Can someone provide me an example and explain to me what is it and what does it do? ...
[1 reply] : int *ptr; ///pointer , these ppointer can only store an address to ... (by closed account SECMoG1T)
by krad23
Function with argument by reference
 
Is there any actual difference between these 3 function declarations? int f(int x) { return x; } int f(int &x) { return x; } int f(const int &...
[2 replies] Last: int f(int x) ; Can be called by passing any integer expression - lv... (by JLBorges)
How to read about error expecially about unresolved errors?
 
If I have this error Error 1 error LNK2019: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char...
[6 replies] Last: I see. Thats really annoying. I hope they add that feature on next c+... (by procastination)
Why do I get the wrong answer?
 
When I run this code I get a sum of 473 instead of a correct sum of 495. Why am I not getting the right answer? #include<iostream> using namespace std;...
[4 replies] Last: sum = *p + arysum(++p, --size); I suspect undefined behavior (but I ... (by pheininger)
by msrt92
Convert code from java to C++
 
Please convert this code from java to c++ :) public class Organization { // instance variables ArrayList<Employee> list = new ArrayList<Employee>()...
[4 replies] Last: Thanks You so much dear (by msrt92)
Why is my loop not working?
 
Why is my loop not working? Can you please help me fix it? #include <iostream> using namespace std; const int JANUARY = 1; const int FEBRU...
[1 reply] : Line 85 while (dates_invalid=false); You are not checking anything... (by closed account 2UD8vCM9)
If then Else
 
im trying to make this program work. it is supposed to print man when we enter male,Male,M or m and female if anything else is entered.... but it prints man all...
[6 replies] Last: now its working.. thanks alot.. much appreciated... :) (by SohaibAJ)
Pairs with vector
 
Hello, I want to use std:: pair with vector, how should it be implemented? I have this so far #include <utility> #include <iostream> #include <...
[3 replies] Last: string values to type int You want to convert strings to correspondi... (by MiiNiPaa)
by clodi
Array VS matrix
 
Hello, I know that I have been asking about arrays 2D arrays and matrixes for a quite a while but feel that so far I haven't been able to come up with the righ...
[4 replies] Last: You have to explain more, because your code fragment merely gives an e... (by keskiverto)
by clodi
Dynamic arrays VS normal arrays
 
When comparing multi dimentional arrays and vectors, nobody really seem to care for normal arrays. What's the advantage of an arraay being on the heap rather on...
[5 replies] Last: Also dynamically sized arrays are not possible to create on stack. (by MiiNiPaa)
Palindrome Recursive Checker
 
I am trying to write a recursive function that checks if an array is palindrome (if it's reversed, still the same). I hate two testers in main, first one sho...
[3 replies] Last: Thanks, It's working perfectly now. (by DeathLeap)
Issue with a function that doesn't execute inside of another function.
 
I'm writing a program that takes in three strings ie. 123.45/N 23.44/S Location Name, then the user inputs the number of locations they want to compare the dist...
[1 reply] : Not sure. Lines 14 and 15 of void getTotalLocations(int amountInput)... (by soranz)
Why this code is not giving error?
 
Why this code is not giving error? We cannot declare the same variable twice but here when the inner loop terminates and re-enters every time i is re-declared. ...
[2 replies] Last: @Esslercuffi, yeah I corrected what u said and I understood what u sai... (by thehitmanranjan)
Help needed
 
I'm having issues with this program; here's the description of what I have to do: The Galactic Research and Development Division has discovered a number of n...
[4 replies] Last: So it seems that i forgot to ask the user to input the lifeform displa... (by JayJay007)
Fraction Calculator
 
Hi, so I'm trying to make a fraction calculator where the user can input anything in expressions with the '+' and '-' operations with any amount of whitespace. ...
[2 replies] Last: How exactly do you plan on parsing the input string? You're straying ... (by Esslercuffi)
Commander CLI Game playing up
 
Hi so I'm following a tutorial on making a CMD game with mages, warriors and archers. Everything seems fine EXCEPT when I try to send in anything except a warri...
[3 replies] Last: Thank you! It was a video tutorial and the guy was going quickly, I mu... (by NewCComer)
October 2014 Pages: 1... 1617181920... 70
  Archived months: [sep2014] [nov2014]

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