Beginners - April 2014 (Page 63)

gets_s
 
Write your question here. What is the difference between gets and gets_s? I tried to use gets in a program, and the debugger said it was unsafe and to use g...
[2 replies] Last: Thank you very much. (by phztfte1)
character arrays
 
does anyone know how to compare 2 character arrays position by position using a for loop? and then if the characters in a position are the same,increment a coun...
[1 reply] : What have you written so far? Surely you know how to write a basic for... (by LB)
tic tac toe! help
 
Hey, so im new in programming and im trying to get this program to call a file, and display the tic tac toe board using multi-dimensional arrays. i feel like it...
[no replies]
lottery error
 
Hi guys, I need help in solving the following problem below. if I chose numbers 2 2 3 3 4 and the lottery chose 2 3 5 7 0, I get 4 matches. The program counts...
[no replies]
Text file data calculations
 
Hi The program below reads in a text file consisting of two columns. If the two columns are called x any, i want to multiply x and y for each row and display a...
[9 replies] Last: Take another variable named initial_product:- #include <iostream> #i... (by anmol2701)
Looping and shortening
 
When I run this, if I enter a value that is less than 0, like lets say a character, it just spams the question over and over again. Also is there anyway to s...
[7 replies] Last: works perfect, thank you both (by football52)
by locolo
Associate any variable to character
 
Im trying to create a program that continually reads (loops) a single character from the user and, regardless of the input, displays the ordinal (ASCII) value o...
[4 replies] Last: Thanks guys (by locolo)
Question on Pointer tutorial
 
Reference http://www.cplusplus.com/doc/tutorial/pointers/ I can't seems to compile "foo = &myvar;" but I can compile "*foo = &myvar;" Did I miss out any std...
[5 replies] Last: ah...ok. got it. thanks! (by wuming79)
Read specific line from text file.
 
I have a text file that I would like to read a specific line from. All lines have the same amount of characters (one 3-digit number on each), and I would like t...
[11 replies] Last: Seeking to an arbitrary position in a file stream opened in text mode ... (by JLBorges)
Lottery Code
 
Write your question here. This is my CSC102 hw, i need help in knowing what to do? Write a program to simulate the lottery. The program should work as follows...
[5 replies] Last: thank you for your help, thus far, however i have written my code like... (by CelestialX)
Trying to understand static members
 
Quick question, why does the compiler say "undefined reference" when I do something like this? //snippet of stack.h class stack { static double runni...
[5 replies] Last: Thinking that linkage is weird (I do too) is entirely different from t... (by LB)
Linked Lists
 
Hello I am creating a linked list program. I am getting an error below saying "expected type specifier before ""temp;". Any ideas, hints, clues? Thanks. void...
[2 replies] Last: Yes I figured it out. Thank you Anyways Cody. Also the "delete temp" ... (by alee4408)
by Aemmel
vector value changes unexpected
 
I am making a little game (just console) and my vectors don't act like I think they have to. One Value of the vector just changes and I don't know why. The Code...
[3 replies] Last: It looks like you have precisely the same problem as here: http://www.... (by LB)
by Zexd
CPU usage
 
Hello. I wrote code below on Ubuntu and it seems to eat whole 99 - 100 % of CPU usage (according to htop). Any suggestions on minimizing usage? #include <ios...
[1 reply] : There is no such thing as a truly empty loop - all loops must do two... (by LB)
Vectors
 
Hi I have the following code below. however it crashes. The problem seems to be the i+1 part in line 4. How do I go about fixing this? Tried j=i+1 and tried ...
[2 replies] Last: Makes sense and works. Thanks! (by JasonMcG)
by Huppa
How would I combine these two lines?
 
I need to find a number between 1-19 that is an odd number. I know the two lines would be: if (n>=1 || n<=19) { //do stuff } And... if (n%2!=0){ //do ...
[2 replies] Last: @Disch, Thanks for the help, everything is up and working. (by Huppa)
by jay101
help....reading numbers from file and arranging them
 
hey guys, i'm new in c++ programming. i need help with C++ code with functions to read from a text file a sequence of numbers of arbitrary length and print out ...
[1 reply] : #include <vector> #include <iostream> int main(){ std::vector<int... (by ne555)
by merta
Adding Problem
 
This test program for the function add, does not work well. I think, after it creates a node for circular linked list, it is not create or add another node in t...
[3 replies] Last: it was intentional, ı try to create a pointer that points to circula... (by Disch)
Why does the intro message repeat
 
Alright well the program is working over all great but for some reason once it runs once and goes to repeate the into message is displayed twice could some one ...
[1 reply] : your code is hard to follow with all those global variables. I guess t... (by ne555)
having trouble with referencing an array
 
Wrote a small banking program for my intro class. Everything seems to be fine except for the fact that when I use the new_acct function, the new elements added ...
[3 replies] Last: Look at the array indexing. Lets run a very simple example the way yo... (by keskiverto)
April 2014 Pages: 1... 6162636465... 67
  Archived months: [mar2014] [may2014]

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