Beginners - September 2009 (Page 5)

by knh8
Limit the number of digits in an output
 
... because I don't know the search query for it. D: So let's say I have a number 1234567 but I want the output to only show 5 digits. So the result must be ...
[1 reply] : cout << 1234567/100; (by Bazzy)
Depreciation Table
 
I need a help..this is for my project.... i need to create an depreciation table using do while loop in c++..... method to be used are: straight line...
[6 replies] Last: #include <iostream> using namespace std; int main() { doubl... (by jemiah06)
Padding Numeric Outputs
 
I wrote a small program that generates CSV files for large data testing. The data is generated in a sequential matter. For example the output in the txt file...
[2 replies] Last: Sorry, I haven't enough time. This code makes the followings: 00000... (by screw)
Program running time :)
 
Hello I use code::block ide with mingw compiler and when I run my program it shows me how much time has passed since i was running my program (execution time: w...
[4 replies] Last: thanks a lot yadude1e3 :) (by aliens112)
Bit of trouble with overloading assignment operator (=)
 
Hello. I'm trying to get my class/object to able to work with code like c = a + b The problem I'm having is that my overloaded operator (=) seems to work ...
[2 replies] Last: OP here. I've figured it out. I didn't have a copy constructor and ... (by Anon1113)
by ronak
Comapre Two diff data members
 
class member { public: int mcode; void min() { cout<<"\nMcode:\t"; cin>>mcode; } }; class product:public member { public: int pcode; v...
[3 replies] Last: Here is a problem: if(sales::scode == product::code) { strcpy(sal... (by screw)
by argio
Compiler Error: Access violation (Segmentation fault) raised in your program.
 
Access violation (Segmentation fault) raised in your program. I received this error when I ran my program after compiling it. I can't find the error in my c...
[no replies]
simple problem
 
Okay, so I had to create a program that would take a number in the range of 0 to 6 and a second number in the range of 1 to 366 as input. The first number repr...
[2 replies] Last: Yeah I just saw that. I was reading up on the error. Stupid mistake on... (by Joliedoll)
quick question
 
I have this question for a homework assignment: The following program segment is not supposed to print anything, yet it outputs the first error message, "Err...
[9 replies] Last: that's what I thought, thanks! (by Joliedoll)
how to process many input
 
I'm writing a little program which has to process as many pair of number as the user wants to input. I wrote the code to process one pair of number, no problem,...
[3 replies] Last: Use a while loop around the go you want it to repeat. ( Like in you... (by firedraco)
by wtf
How to check for eof in file pointers?
 
in fstreams you have eof() member function. how to check for end of file when reading from a FILE *?
[1 reply] : I believe it sets the global errno to eof or something (go look up t... (by firedraco)
by wtf
Why won't fclose work?
 
I've narrowed the segmentation fault down to the line: fclose(outputfile); What am I doing wrong? code executes fine until then, but nothing after...
[1 reply] : You could have knackered you program earlier. How was outputfile init... (by kbw)
by wtf
How to check of successful opening of a file pointer?
 
When using FILE * fin; how do you check to see if opening of a file was successful or if the current file is currently open? this doesn't work: ...
[1 reply] : FILE *fin; //... fin = fopen("text.txt", "r"); if (fin == 0) ... (by kbw)
Scan For Devices On USB Host Controllers
 
I was handed down an assignment at work today and I don't know where to start. The goal of the program I am supposed to make, is to find a specific device conne...
[4 replies] Last: By the way, the HostController names are like this: HCD0, HCD1, an... (by guestgulkan)
by wtf
What do you all think of this method for declaring an array dynamically?
 
#include <stdio.h> #include <string> #include <iostream> using namespace std; string str; int size; char ch; int main() { printf("Enter a st...
[3 replies] Last: The way to allocate dynamic arrays in C++ is using new : char *char... (by Bazzy)
Parentheses?
 
This code snippet is from Tier One: C++ Beginner's Guide by Herb Schildt Is there some proper etiquette used here to give reason to the parentheses in ques...
[2 replies] Last: Thanks!! Just trying not to create bad habits. (by Triryche)
by DBarzo
How to cast uint8* to short*
 
Hi, I send data over the network with a function like this: SendData(void* data, int size); where data is a 'signed short*' On the other side I get th...
[7 replies] Last: Ok, I know. But the library I use (it is an rtp library) take care ... (by DBarzo)
by robezy
Unit testing tools for c++
 
Hi Guys, Could any tell me what are unit testing tools available for c++ and which one you recommend. Thanks
[1 reply] : Have you done a google or forum search yet? This question has been as... (by kempofighter)
Just When I Though I Understood Pointers
 
Just When I thought I understood pointers I run across this example: int main(){ char *s = "hello world"; *s = 'H'; return 0; } Why ...
[5 replies] Last: You can allocate memory: char *c; c = new char ; sprintf(c,"hello"... (by Bazzy)
Counter Not Working
 
EDIT: Nevermind. I figured it out. So, so, so ridiculous. Okay. Here's the premise of the program. The program must read in a student ID and 3 exam ...
[no replies]
September 2009 Pages: 1... 34567... 23
  Archived months: [aug2009] [oct2009]

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