Beginners - December 2010 (Page 21)

backspacing so that after cin>>, you don't go to new line
 
for example, say i write int main() { string name; cout<<"Enter your name: "; cin>>name; cout<<"..........Name entered\n"; return 0; } ...
[15 replies] Last: windows.h is heavy and is (for obvious reasons) unportable. You could... (by DeusExInfernus)
Difference between #define and string?
 
Hi, I would like to check what is the difference between #Define and string declaration when it come to myfile.open(). I'm able to compile successfully us...
[2 replies] Last: avoid #defines whenever you can, they're unpredictable (by quirkyusername)
Iterating over a char array using pointers
 
Hi, I am reading the Stroustrup book. There is a example to find the length of a string held in a char array. int length_of_charachter_string_2(char* ...
[4 replies] Last: Thanks (by indy2005)
C++ please quick hlp.
 
Hii everyone i think there are few errors in this code and there is also some modification required pl. help me with it..i did what i cud. Thanks Here is th...
[6 replies] Last: Alright... If you're trying to keep the console open after you ente... (by Albatross)
"Undefined reference" error in Tic-Tac-Toe
 
For a simple Tic-Tac-Toe game I created a function C_choose(char pin ) to choose the moves of the computer and verify the move hasn't yet been made. The call, ...
[3 replies] Last: No problem! I do this all the time, and I've been programming for awh... (by kooth)
Something Wrong with Program
 
I started coding a program and the first function I'm coding is supposed to get a weight factor from the user and use that factor to return the planet (planets ...
[2 replies] Last: Thank you I fixed it to all if else statements instead of using the sw... (by UMES Programmer)
by yulz
assigning a digit from a string to a variable
 
hi im trying to assign the first and second entries from a string to other variables string answer; cout << "enter a string"; cin >> answer; if (isa...
[4 replies] Last: Let's say you have a string called in and you need the ints var1 and v... (by DeusExInfernus)
array of integers whose size depends on a variable
 
heya. lets say i have an ifstream name input. the file contains: 4 9 2 6 10 lets say i store 4 in a. how can i make the size of array a dependant ...
[3 replies] Last: thanks for the information, really helped me alot :) (by award982)
by rej3kt
Simple class I'm struggling with
 
This is my simple main, i'll leave out the includes and header files: int main() { double loyaltyNumber ; int loyaltyPoints; char loyaltyExpir...
[4 replies] Last: Found out the problem was actually that I was writing an integer to a ... (by rej3kt)
Any performance improvement by using exception?
 
try { int * myarray= new int ; } catch (bad_alloc&) { cout << "Error allocating memory." << endl; } I am newbie in c++ programming, but I re...
[2 replies] Last: Exceptions are not there to improve performance, but to make your life... (by ernestus)
c++ copy highlighted text??
 
I am using c++ windows form application What is the function that lets me copy highlighted (selected with the mouse) text in a webbrowser to a string? p...
[no replies]
numerical integration lower limit,upper limit
 
#include <fstream.h> #include <iomanip.h> #include <math.h> #include <iostream.h> #include <stdlib.h> using namespace std; double f(double); int m...
[10 replies] Last: if you set area = 0 before each new calculation your code is correct e... (by slicedpan)
game loops and setting up sfml (1,2)
 
1) So I have a quick question about game loops. Is it better to do a bool shouldExit == false; while (shouldExit == false) { ... // program //psuedo /...
[34 replies] Last: i actually found it, i tried creating another project and then it was ... (by ERanz21)
by Maerle
simple tic tac toe game
 
I'm with a problem with this game. It compiles perfectly, it runs fine. The problem is only that I don't know how to forbid the player of play in a space that w...
[1 reply] : up! (by Maerle)
by dznguy
Classes with an array
 
my header #include <iostream> using namespace std; const int maxMonth =12; class Stats { public: Stats(); //default constructor Stats(double); ...
[3 replies] Last: [quote=dznguy]i still a need an array The array you'll use inside yo... (by m4ster r0shi)
Saying that MID is not being initialized
 
I have been working on this code now for about a month and still am getting errors at line 88 when I am doing a binary search for a data structure. The full co...
[7 replies] Last: oops, i overlooked line 95. so you can't change line 78 instead write ... (by coder777)
DLL import functions
 
Hi community, i have a dll that read 3D files, there are 2 function for read files: Read_t_old and Read_t_new. But the parameter are "class CTStream *, int" i ...
[1 reply] : anyone know how to do this? (by FadeToBlack)
by sevans
C++ I/O functions and struct with arrays and strings
 
Hey im new to c++ and am having a really hard time with this program, please help! Im supposed to design a program to read racers from a text file, sort them...
[no replies]
Accessing member function from list
 
ok heres what I'm trying to do, first I make a class class Name { //stuff memberfunction () {return something;} //more stuff }; then I add new...
[5 replies] Last: It worked thank you ne555 (by Toothkiller)
Sorting and Strings
 
I am supposed to write a code that brings in phone numbers and names from a file and sorts them in alphabetical order by last name and adds hyphens to the numbe...
[no replies]
December 2010 Pages: 1... 1920212223... 35
  Archived months: [nov2010] [jan2011]

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