Beginners - October 2012 (Page 80)

Problem with a begginer exercise
 
Hello, I'm learning by myself C++ and I have to create a program that converts a cipher of seconds into minutes and hours. This is the code I typed: #includ...
[1 reply] : remove the & should look like this printf ("Equivalent to "); prin... (by Serri)
Nested Loop
 
I am supposed to use a nested loop to create a 10x10 pattern of 9's. It's not filling in the middle. #include <iostream> using namespace std; int main...
[2 replies] Last: LOL wow... thank you (by nothing3)
inputting into a text file...only more complicated
 
i know that cin will end after the first white space so im supposed to use getline instead, the problem using it like this "myfile << getline (cin, line) "give...
[2 replies] Last: #include <iostream> #include <string> #include <fstream> using nam... (by devonrevenge)
can anyone help me with reading txt file into a data structure?
 
it shows me a warning in this line: fscanf (myfile, "%d %s %s %s", clothes .quant, clothes .type, clothes .brand, clothes .descrip); warning: cannot...
[1 reply] : you should use the c++ version of the filestream: http://cplusplus.com... (by Fransje)
Trying to display the prime numbers between 1 - 100
 
Hello, I'm a beginner at C++ and am having some difficulty attempting to create a program for my C++ class that involves listing the prime numbers between 1 and...
[2 replies] Last: I do not know how to make it more efficient, as in writing only one or... (by youngcoder13)
C++ Video: Maintain is-a Relation for Public Ineritance
 
A good programming practice requires us to maintain is-a relation between base class and derived class. However, sometime things can become tricky. This video ...
[1 reply] : Im confused about this. I'm under the impression that overloaded func... (by pogrady)
bit fields
 
struct marks{ int p:3; int c:3; int m:2; }; void main(){ struct marks s={2,-6,5}; printf("%d %d %d",s.p,s.c,s.m); } acoording to me output should be...
[15 replies] Last: Other than the fact that I showed going from an 8-bit signed int to a ... (by doug4)
Program doesn't work as expected
 
My task is to create a program which inputs a positive real number and returns the hundredths digit of that number. For example, entering 34.55 should return 5....
[2 replies] Last: I think it's the inherent properties of floating-point values which ar... (by Chervil)
Help with table.
 
Hello, I cannot seem to get my 2 to 12 times table project to align from the 10s down. Tried adding an if else to change setw by one this does not help so retur...
[1 reply] : Try changing this: cout<<i<<setw(5); to this: cout<<setw(... (by Chervil)
by skarla
question
 
#include <iostream> using namespace std; int main() { int i; cout<<"How many places:"; cin>>i; int p ; if(p==NULL) { cout<<"No memo...
[3 replies] Last: Also I would like to append that this code (the if statement) if(p==... (by vlad from moscow)
How do I go about making a ordered linked list using classes?
 
Hello friends :D! I need to make a singly linked list that puts items in order based on their 'position' value. It takes the 'position' values from the command ...
[1 reply] : Create two new nodes, 'cur' and 'prev' and assign cur to the head of t... (by TheJJJunk)
Recieve & Send Functions
 
Hi all, I have a function below "readIn" that reads the data it recieves from an external source and puts the data in the given bytes of array. I need to sen...
[1 reply] : Putting them in a string and returning it? Extra work right? (by Aceix)
Problem with editing in Visual Studio Express 2012
 
Hey there, say my program looks like this #include "std_lib_facilities.h" int main() { cout << "Please enter a floating point value: "; double n; ...
[2 replies] Last: Awesome, man. Thanks a lot. Appreciated. (by kintaro26)
explination
 
int n=12; cout<< n++<<endl;//12 cout<< ++n<<endl;//14 cout<< n+++1<<endl;//15 cout<< ++n+1<<endl;//17 cout<< n+1<<endl;//17 cout<< n<<endl;//16 i have ...
[3 replies] Last: n++ n increments after instruction was made ++n n increments befor... (by gtkano)
Having an error message
 
I just downloaded Microsoft Visual Studio 2005 but when I tried it out and pressed (Ctrl + F5) or start without debugging It gives me this error Unable to s...
[2 replies] Last: I had the same problem. I followed these steps.(im using 2010 express)... (by vichu8888)
by grs
C++ code doubt
 
Why line B is getting executed before line A in following cpp program ? As after running,the line A displays after you press EnteR. but getchar comes afte...
[8 replies] Last: Yes i have tried fflush(stdin); Was that a simple typo? I was referr... (by Chervil)
what is the output
 
int n=2; switch (n) { case 1 : n=n+1; break; case 2 : n = n+1; case 4 : n = n + n; default : n = n – 1; } cout<<”The value of ...
[1 reply] : It seems each case is missing a certain keyword. Wazzak ... (by closed account zb0S216C)
making a console game and having a trouble with key input
 
i have made a simple ping pong game and i would like to make the panel to move when the key was pressed but the ball itself would wait a time period... here'...
[3 replies] Last: Great! (by X0rify)
issue
 
I attempted the program and posted the questions again. there is no need to be sarcastic its my first time using this website and i saw beginners so I thought ...
[1 reply] : http://cplusplus.com/forum/beginner/80593/ http://cplusplus.com/forum/... (by Stewbond)
by lyn18
cout problem
 
this is my program. #include <iostream> #include <conio.h> using namespace std; int main() { int num, isPrime,i,n=10, max=0, min=99, even=0, ...
[4 replies] Last: Yes try that. (by Ch1156)
October 2012 Pages: 1... 7879808182... 84
  Archived months: [sep2012] [nov2012]

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