Beginners - January 2011 (Page 7)

Should I never use goto?
 
Should I never use goto? My book says that it is bad practice.
[5 replies] Last: Just don't use it. Act like you've never heard of it. (by shadowvillian)
Basic Input/Output - cin and strings problem
 
Hello everybody, I'm new here.. I'm trying to follow the C++ Language Tutorial but got stuck on Basic Input/Output chapter. Here is the simple code that'...
[11 replies] Last: i coudnt get the wink to work either. in debug it skips past it and as... (by acorn)
Assignment
 
hey i have been given the following assignment, but i cant understand it. Can anybody elaborate it. Thanks. A cup of water (250 ml) is heated from 0 to 100 C...
[3 replies] Last: The code looks ok by just scanning it over. Did it compile? If so, pu... (by pwnedu46)
Reading from a text file(strings and numbers)
 
Hi, I'm having trouble with an assignment. I have to open a text file like this that sorts the highest GPAS and Names Joshua 3.1 Margaret 4.0 Jared 2.7 It...
[6 replies] Last: wolfgangs code works perfect for me. i am using codeblocks on windows ... (by acorn)
I can't write the line equation y=m*x+b
 
Hey guys, I recently started to learn c++ and I'm having trouble with writing a simple program to calculate the slope intercept form of a line equation given tw...
[7 replies] Last: #include <stdio.h> int main() {float y1, y2, m, x1, x2, b; char x... (by cjbeezy)
Selecting random words for Hangman?
 
I have textfile in which random words are written line by line (no whitespace) I don't know the size of the file or how many words are in it. my task is to add ...
[10 replies] Last: It's the getline from the string header. temp was meant to be a std::s... (by wolfgang)
i cant see everything in my console window
 
When I run this program I can only see the last 250 lines. Anyone know why? I'm running windows 7. #include <iostream> #include <vector> #include <list>...
[3 replies] Last: If you just care about visualization, you could try pipe or redirect t... (by ne555)
Game in c++
 
Hi to all, I wanted to make a simple card game in c++: The player starts off with 100coins and 4 random cards will be given to the player, there will be 50% of...
[7 replies] Last: I've managed to make it, it's really cool i like it very much. :) (by Alex cpp)
strtok() usage
 
Hello i was tried to use strtok() to make array of words but i can't char** word = new char* ; word = strtok (str, " ,.!?"); for(int i=1;i<wordCount;i+...
[2 replies] Last: then how to count the words in this string ? (by theimmortalbg)
strtok() in array
 
Hello i want to save each word of the text in an array but i cant. This is my code: #include "stdafx.h" #include <iostream> #include <string> using names...
[4 replies] Last: either -tokenize the string like you do -allocate an array -use my ... (by hamsterman)
by Zeikko
C++ vs C# for game programming
 
Hi! I started programming with C++ about 10 days ago, and I'm still in basics (best program I have made is Tic-Tac-Toe( http://pastebin.com/DgsWxL7T ) from s...
[4 replies] Last: if ya dont mind the move a country away i know DICE is based in stockh... (by rjd82AA)
Vector template
 
This is a simple code printing the elements in a vector template. But if I define (in line 8) vector <T>::iterator i; rather than vector <double>::i...
[2 replies] Last: Thanks! (by dohxx004)
switch
 
Hi there, i am trying to test some code but i am stuck with an error message : error C2196: case value '1' already used... Here is the code: switch (ch...
[4 replies] Last: i didnt read all your code but instead of checking for both upper and ... (by acorn)
Calloc( ).
 
I started to learn about calloc( ); today. When I created an array with calloc( ); I was wondering, "How do I access each of the elements I created?". H...
[2 replies] Last: All right then, I won't use it anymore. Thanks Disch. (by closed account zb0S216C)
Broken if else statement
 
The program is pretty simple. It takes 4 input values and compounds interest either over periods or continuously. The if statement won't work though. No matter ...
[8 replies] Last: Alright I went ahead and did this: double s_amount = 0.0, inte... (by jesterfanatic)
Question on dynamic memory allocation
 
Hello All, I am a new C++ programmer but not new to programming (Matlab etc..). I am trying to understand the benefit of using "new" to get dynamic memory ve...
[6 replies] Last: Final note...In the build options I was indeed able to select the stri... (by hobbycoder)
Passing an Array Safely
 
Is there a another way to pass an array safely in a function? I normally do it like this: void Function( int PassedArray[ ] = NULL ) { if( PassedArray ...
[5 replies] Last: There's no need for boost. Check your implementation for std::array or... (by filipe)
by acorn
vector of vectors again. attempt #2
 
can someone show me a better way of accessing these elements besides the subscript operator. I cant work it out because of the nesting of vectors. the vector s...
[5 replies] Last: vector::at returns a reference to the object contained ( exactly as op... (by Bazzy)
Struct problem
 
Hi My English is bad.So i make excuse for false understanding right now.I have a problem with about structs.My problem: #include <stdio.h> #include <iostre...
[7 replies] Last: I passed my all blocks.And i found a func. My codes end affair: #in... (by Helegurbann)
by GulHK
vector find error
 
................
[5 replies] Last: Then that's your problem, because std::find() relies on it to compare ... (by filipe)
January 2011 Pages: 1... 56789... 42
  Archived months: [dec2010] [feb2011]

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