Beginners - April 2012 (Page 28)

pass strings
 
Hello, I have been trying to use a string I am reading in another function. It seems the string is not passed to following function. To be clear here is my...
[4 replies] Last: You can pass string object by reference if you will declare your funct... (by vlad from moscow)
Code Crashing - Possible Memory Management
 
I've written a rather hefty algorithm that requires storing very large arrays, and I believe it's making my code crash. I get the following errors: "ViscousB...
[3 replies] Last: Stuff defined in a function is allocated on the stack. Stuff defined ... (by cire)
Can someone help simplify the end of this?
 
can some one simply the end of this program with while loops and please explain why you solution works? #include <cstdlib> #include <iostream> using namespace...
[2 replies] Last: Without changing its behaviour in any way, the program can be shortene... (by JLBorges)
Double to Single space after punct
 
So, just need someone to help me figure out what's wrong with my code, and how I can fix it. I've looked up other sources, but I'd rather someone who knows what...
[4 replies] Last: clanmjc said: I think this will help you clean up your code, pay ... (by eyesofhope)
Making a Calender
 
Hey, me again, asking for help on an assignment. I can't get the days of the month to stick no matter how I call it. right now this is where I am. Header f...
[1 reply] : Static member functions can only access static member variables. (by vin)
structures/pointers help
 
I have been going around and around with this code. It may be that I just dont have a firm grasp on how everything works. Could anyone help me identify why this...
[2 replies] Last: Thank you! I understand now why it doesnt work! Your awesome! I ended ... (by arrow821)
Reading and writing... Problems in while loops.
 
Write a program system that reads several lines of information from a data file and prints each word of the file on a separate line of an output file followed b...
[3 replies] Last: If the infile has a newline as the first line you will have an infinit... (by vin)
Strings
 
I was wondering if I would declare array as an int or char? or what I have to use pointers. Create a single dimensional array of chars (10 elements) called...
[1 reply] : Your assignment specifies and array of chars. You won't be able to sto... (by iDontGetIt)
Help needed in Snake Game
 
I am having problem in Snake game , my snake is moving rightwards only , it doesn't moves in any direction , I am confused what is wrong with my code . Please h...
[2 replies] Last: Sleep(2500); system("CLS"); there are betters ways to do this that a... (by ui uiho)
by manp
counting the number of times that a command has been issued/or a function has been used
 
Hi, I have written some codes for a program that does Ascii-art. I wrote it with a class and some class member functions. I have the command " canvas x y" th...
[3 replies] Last: static int counter; and then in your constructor for the class jus... (by ui uiho)
random noob questions
 
#include "stdafx.h" #include <iostream> using namespace std; int main() { int myarray = {5,5,5,5}; int count=0; int sum=0; do { sum += ...
[4 replies] Last: Well, because C++ doesn't do any bounds checking on normal C-style arr... (by Albatross)
How to keep program from ending
 
I have my program working for the most part except I don't want the program to quit working as soon as it finds a false statement but to ask me again to enter a...
[4 replies] Last: I feel like I should butt in here. :) ul hlho's while loop could pote... (by Albatross)
by dross
Problem with file
 
The output should be showing Question 1 1a 1b 1c 1 as a string, string array of 3 choices and an int in a struct getline(triviaFile, tempFile.tempQuestion); f...
[2 replies] Last: Here is the full code. #include <iostream> #include <fstream> #inclu... (by dross)
by tw3tye
C++ File loading problem
 
Hello. i have declared class"Map" with Fchar and Fint; im just tring to read data from file and store them in Fchar and Fint Is this code bellow good? my file i...
[1 reply] : Filee = fopen("./files/file.txt", "r"); make it filee.open("file.... (by ui uiho)
Easier way to make a roguelike?
 
This is my attempt at making a simple room in a roguelike, obviously it's very glitchy and doesn't have much logic behind it at all, but it took quite some time...
[1 reply] : I would recommend not using the console and using a lib better suited ... (by Disch)
Switch statement help needed
 
I thought of this as a simple project to help my understanding of C++ better. I wish to let the console loop the output so I can effectively keep entering w, a,...
[12 replies] Last: tried to keep it simple but yeh, that is what i was going for. (by ui uiho)
have anyone here learnt c++ completely without going to any institute or classes.
 
I am a beginner in c++,so tell me where and how can I start to learn.I don't want to join any institute or classes,but want to master in c++. well i am in 12th ...
[6 replies] Last: Look around: you can develop almost every program you have on your pc.... (by S G H)
(unwanted) Non-deterministic behavior
 
The program (my first from scratch) is supposed to take 492 data pairs from a text file written in this format: m 94.2 k 89.4 i 87.1 a 86.9 ...and ...
[2 replies] Last: Wow, I knew it would be something stupid and simple. Works now. Thank ... (by Aminimus)
lnk2019 error
 
Problem solved! thanx guys. i can't believe i made such as dumb mistake Hello cplusplus forums. i am having a problem with this code. i am getting these two e...
[2 replies] Last: Make sure all the files are added to your project. It looks like it do... (by Peter87)
ispunct Function in C++
 
char punct(char a , int len) { for (int i = 0; i < len; i++) { if (ispunct(a )) { return i; } return -1; } } Could anyone tell me why this fun...
[1 reply] : I couldn't help but notice that your return -1 statement is in your ... (by Albatross)
April 2012 Pages: 1... 2627282930... 66
  Archived months: [mar2012] [may2012]

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