Beginners - February 2012 (Page 34)

Randomize
 
Is this code logically correct radomize(); time(); int s=rand()%10 info:this cod runs in turbo c++ borland
[1 reply] : If you are trying to put a random number into variable s , you should... (by hnefatl)
by shangy
Calculating inputs using While and For Loop
 
I need a help on this program it needs to calculate multiple number inputs using While Loop firstly and try the it with For Loop again. #include <iostream> us...
[3 replies] Last: thanks Stewbond (by shangy)
Unsigned long size
 
How do you limit the size of unsigned long? I am trying to istringstream data from a file and separate them by commas. For example, the first set is a date and ...
[3 replies] Last: Stewbond, the date "19971002" is showing as 3435973836 when ofstream ... (by yoitsmejy)
How to input different data types into array?
 
Help out the biologist please: I have a tab-delim data set that looks like: (no acutal header row this is just for clarity) Library Position ...
[15 replies] Last: cire, I can see that your code is shorter & cleaner. The truth i... (by sicilicide)
Assigning 10 unique random numbers to an array
 
Hi, I am fairly new to C++ and would appreciate some help with this logic here. I need to create an array of 10 integers (1-10) but they should only appear once...
[8 replies] Last: #include <stdio.h> includes the implementation of rand() rand() ... (by ne555)
kindly help me to solve this problem
 
microsoft c++ Cable Company Billing Write a program that calculates a customer’s bill for a local cable company. There are two types of rates for calcu...
[3 replies] Last: please stewbond its just an activity for us please (by janmich07)
by atjm88
How to make repeating for loop become one?
 
#include <iostream> #include <iomanip> #include <conio> int main() { int j; cout<<"\n\t Multiplication Tables"; cout<<"\n_________________________...
[3 replies] Last: I mean to make a loop just by using "i" and "j" and something like "i*... (by atjm88)
by atjm88
Switch
 
Hi, how the sytem read the input from my computer as 1, 2, 3, or 4? is that read from the case name? eg: case 1, then if i input 1, it will read from case "1"? ...
[18 replies] Last: I tried to check what's the number of "choice" actually and 1st expect... (by atjm88)
by tarmer
Trying to compile - errors
 
Good Day all.... What I have is a soccer game source code (it is a text based game) - I want to make some changes to the code and change some of the features...
[9 replies] Last: The 'first' error is about your #include "game.h" . I don't know if y... (by tarmer)
Need clarification on OPS_GetInt
 
I am a structural engineer, trying to modify source code of one of my software to write my own element. I came across following code line, that I could not un...
[2 replies] Last: OPS_GetIntInput is a function. This function accepts two parameters.... (by Moschops)
by atjm88
#include <iomanip>??
 
#include <iostream> #include <iomanip> #include <conio> int main() { cout<<"\n\t Multiplication Tables"; cout<<"\n_________________________________...
[3 replies] Last: Pretty much. http://cplusplus.com/reference/iostream/ This contains ... (by Stewbond)
by musico
Connecting to SQL Server
 
Does anyone know a template for connecting to SQL server from C++. It appears to be ODBC but I can't get the exact information I need to locate a database. I ...
[2 replies] Last: You may also use SQL Anywhere with their included SDK. (by FlashDrive)
by trojsi
Overwrite data in a string
 
I been experimenting to modify data in a string with string.replace and string.erase but now I need to overwrite say 20bytes with say 10byte word but leave the ...
[6 replies] Last: May you please show me the source code? Then I'd be more able to judge... (by FlashDrive)
Mock exam help please...
 
Hey guys I'm in my first year studying c++ and I have the questions for a mock exam in which I didn't too too well in :( , I was wondering if any of you seasone...
[10 replies] Last: 2.) parameter names for void setparam(int a, int b) are the same as t... (by closed account z05DSL3A)
by Steves
Tic Tac Toe Help
 
Hi guys I'm trying to write a simple two player game of Tic Tac Toe that has a board with numbers 1 through 9 on it. when player one hits the 1 key the one turn...
[19 replies] Last: Okay so I basically have the whole program now, but I have a few issue... (by Steves)
prime
 
#include <iostream> #include <cmath> using namespace std; // Function must be declared before being used. bool prime(int n); int main() { int i; // Set u...
[5 replies] Last: georgep s code with a few mods to make it run faster. //function to ... (by closed account z05DSL3A)
difference between struct and union
 
can someone explain to me what is the difference between a struct and union in c++? i have read some explanation but i need an explanation in lay mans term. ...
[3 replies] Last: struct s are functionally identical to class es only with the defaul... (by closed account z05DSL3A)
I'm trying to understand implemtation of a sparse array(1D and 2D)?
 
I want to write a program that implements one but I don't really understand a sparse array, so implementing it is quite hard for me. Can any one point me to som...
[2 replies] Last: mofosho, Yes I see your point. I will come back with specific questi... (by cpplover)
by trojsi
'0' between entries when reading file to string
 
hi, I am reading a file to string to update the file and write the string back again. After I try to add another 'user profile' to my binary file (append mo...
[3 replies] Last: Sample code please, I'm not sure what is going on. Also, sample from ... (by clanmjc)
Degree of sortedness.
 
Hello, This might not be the best place to ask it, but I figure I'd give it a shot here: I'm looking for an algorithm to judge the "sortedness" of a list of ...
[12 replies] Last: Very good suggestion! It solves the problem of evaluating lists with s... (by Gaminic)
February 2012 Pages: 1... 3233343536... 64
  Archived months: [jan2012] [mar2012]

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