Beginners - December 2015 (Page 14)

first thing i enter into my array dissapears
 
Ok so ive been working on a calculator for binary numbers using chars not ints and the input was working fine i dont know what i did but now the first digit you...
[5 replies] Last: why does the second one work then when they are both the same size ch... (by Peter87)
Variations of Yes/No Input from Users
 
Hello, I am new to C++ programming - and even programming in general - so I am reading along in Bjarne Stroustrup's Programming Principles and Practices Usin...
[4 replies] Last: This doesn't mean what you think it does, if(input == "yes" or "Yes" ... (by Chervil)
by nerded
Getting frustrated with Initializing array of objects (1,2)
 
Hi, my C++ professor is requiring me to initialize an array of objects in this exact format (AKA copy and paste this into the code and leave it 100% intact): ...
[20 replies] Last: Cool! Thank you so much. I'm majoring in CS so I'm just trying to get ... (by nerded)
by luout
Console Game
 
How can I make this game work? I am clueless... I am a beginner and I am expected to create a game. The teacher is crazy! The game is suppose to do this: K...
[no replies]
by Cat32
Linked List Class
 
Hey guys! I was supposed to make a linked list class that linked boxes. I submitted it and my professor said this - "When you insert into a linked list you shou...
[1 reply] : "When you insert into a linked list you should be using the overloade... (by cire)
I wrote a calculator code, want some advice to improve.
 
Write your question here. This is my own calculator code, and I want to improve it. Please give me some advice. #include <iostream> using namespace std; i...
[5 replies] Last: Thanks! (by code writer)
Card Game
 
I have to write a card game and I have no idea how to do so please help me. The card game has to meet the following criteria:  Write a program for “Guess...
[no replies]
by nerded
Creating objects within classes
 
Hello, I was wondering how I would create an object within the private members of a class. My C++ professor is of zero help to me, and refuses to answer any que...
[5 replies] Last: I take that back. You can't forward declare. You must copy and paste T... (by keanedawg)
Reading a .csv file through istream_iterator
 
I have a .csv file that looks like this: Title 1, Title 2, Title 3, Title 4, orange, abc, 12.3, 45.9, tree apple, rto, 34.6, 0.9, ... My code replaces...
[1 reply] : Yes, don't replace the commas with spaces. Use the commas as delimiter... (by jlb)
by AMDA10
pointer confusion
 
Hi, I am having trouble with understanding pointer. Lets declare a pointer. There is no difference between int* someIntPointerVar; and i...
[7 replies] Last: "someIntPointer" means the value stored at the address of the pointer... (by MikeyBoy)
by sep11
2D array from txt file trouble, error message
 
I'm trying to create a program for class that will read data from a txt file and translate it into a 4x6 array, reading it line by line. I'm supposed to minimiz...
[6 replies] Last: Well I figured out the error. Needed to return values. So I managed ... (by sep11)
by GonlyG
Bubble sort problem
 
I have to bubble sort (compare pairs) of numbers in an array until the numbers are in an ascending order, then output number of passes followed by number of swa...
[17 replies] Last: perhaps. (by GonlyG)
ascii vs chinese char
 
Can someone point me to some info about text file handling. The question is: how does a text editor - like gedit - 'know' which type of character it has to show...
[1 reply] : The file is probably stored as UTF-8. Not sure how gedit detects the e... (by Peter87)
How to put an effective counter in my piece of code
 
Hello everyone, I just wanted to give a bit of background for this piece of code before I ask my question. In this code the user has to enter a string of only l...
[19 replies] Last: Okay I did it guys! Thank you so much for the help! It means a lot! (by lampshade009)
V
 
Hi how are you doing
[4 replies] Last: Yes, that looks like it should work. (by Peter87)
delete specific content
 
Hello all I'm new to c++ and trying to develop a program that can delete some specific content from the given file. Is It possible, if yes, then just prov...
[2 replies] Last: thank you Jaybob66 it is solved :) (by jimquisition)
by pqfrm
What's the best way to read this file in for use?
 
So I have the file of states, symbols, capital ect. Here' a snippet: State Symbol Capital Pop Size Zone Nickname Border...
[9 replies] Last: Okay it looks like the file is using fixed sized fields. You will need... (by jlb)
Pointers and strings?
 
Hello guys, so I was learning pointers and strings and I got very confused with the following part. char* cString = "Some string"; so how can this work? I m...
[1 reply] : It's simply a fundamental difference in how the compiler handles "Som... (by Moschops)
Best/ other way to use lambda in this example
 
Hi, so I had this exercise where I have to make a lot of implementations for something similar like accumulate(vec.begin, vec.end(), 0) and check for speed af...
[4 replies] Last: TY very much man :) (by etrusks)
by tdk93
Difference between static short and short
 
The following code just works fine and gives what is expected #include <iostream> using namespace std; int main(){ static short DP ; cout << DP ; } w...
[3 replies] Last: So basically all static variables are stored in heap just like dynami... (by cire)
December 2015 Pages: 1... 1213141516... 43
  Archived months: [nov2015] [jan2016]

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