Beginners - July 2008 (Page 9)

Floating Points and == operator
 
My code: #include <stdio.h> #include <math.h> int main() { double dbl1 = 1.0 / 10.0; printf("dbl1 == %f\n", dbl1); double dbl2 = pow(2.0, -20....
[6 replies] Last: Yep :) But macro's should be well defined in your documentation in c... (by Zaita)
Sorting issue? Completed
 
Aloha, I am using dev c++ and having a slight problem with a sort to a ever building payroll program. The unsorted data come out fine. The sorted data is where ...
[6 replies] Last: Thanks Faldrax. I will keep that in mind for next time. I switched my ... (by tdigdug)
char variable as a bit pattern
 
hi guys. one question. does it make any difference between char and unsigned char if I were to use the variable as a bit pattern? what i want is only th...
[7 replies] Last: @akmalnuenberg: C is still widely used because it has alot of know beh... (by Zaita)
function template
 
Hi, I'm trying to write a function template in C++, and when I compile I get a strange (to me) error. #include <iostream> #include <vector> using name...
[3 replies] Last: Send it to Wellington, New Zealand. Corona please :D (by Zaita)
floating points
 
Hello again, The following Code in C: int n = 10000; float f = 10000.0f; if (n == f) printf("They're equal.\n"); else printf("They're not equal.\n")...
[3 replies] Last: Ok. For example you have 1.9. if your (int) this it will become 1. It ... (by Zaita)
by Nandor
deleting content of files
 
Can someone tell me how can I delete the entire content of a .bin file?
[3 replies] Last: You don't need to delete it before ios::trunc. It automatically erase ... (by Mitsakos)
by Otto
Question about GetPixel(); -function
 
I'm making a 2D platform game and I basically know what I'm doing and how I'm doing, but I need some help with GetPixel(); -function. That should return a RGB v...
[6 replies] Last: I found this thread: http://forums.msdn.microsoft.com/en/vcgeneral/thr... (by Otto)
What is this doing?
 
Well I am doing some tuts and I am been reading some revised code of the examples. Now From my other programming experiances the main is calling for some arg...
[1 reply] : It is usually expressed as int main( int argc, char* argv ) where ... (by Duthomhas)
2D array indexing
 
hi this works int main() { int arr ; *(arr+1) = 10; } this gives error, since its a 2D array .but arr gives the base address when printed o...
[2 replies] Last: thank u (by babu198649)
Arrays and pointers
 
int* a1 = malloc(4 * sizeof(int)); int* a2 = malloc(3 * sizeof(int)); int* a3 = malloc(5 * sizeof(int)); a1 = 1; a1 = 2; a1 = 3; a1 = 4; a2 = 9; a2 ...
[5 replies] Last: Whew. I was worried for a moment there that my brain wasn't working ri... (by Duthomhas)
by hamo94
what does += mean??
 
help i cann't make heads nor tales of this script it was an example in the arrays part of the tutorial i would really apreciate it if someone could explain i...
[4 replies] Last: thanks a million i posted that question a few days ago and since i lea... (by hamo94)
getline() behaving weirdly *the first time*
 
Hi. I'm new to C and C++ (coming from PHP), and I'm currently just playing with it. Below is a sample console program I wrote that promts the user to enter t...
[11 replies] Last: Well, it looks ugly, but it works. There's one small problem left thou... (by boenrobot)
by Jacob
Opportunity to ask a bunch of questions
 
Hello everybody, At first i'm creating this thread to ask you guys something relating content from the basic c++ tutorial on this site, i already had a bit o...
[9 replies] Last: Well my example isn't a card sorter, it is just making a deck(array) o... (by mikeb570)
Difference between loops?
 
Say I want to do something in a loop if something is true. Is this: while(a){ //assume a is a boolean value dostuff(); } different than this: do{ do...
[3 replies] Last: Like someone else said, it is possible for the while loop to run 0 t... (by mikeb570)
primary expressions
 
this the program that im doing.. when i compile it i get the error (expected primary expression before "char" in line 20 and storage size of "B" isn't known ...
[3 replies] Last: When you declare the "B" you use which means that it will be an arra... (by Mitsakos)
read modify write
 
Hello, I am just beginning to learn how to program. I am trying to write a program that reads in a file and then uses several functions ( that I am trying to ...
[1 reply] : The value '2' is the character code for the picture of a 2. If you a... (by Duthomhas)
variable types
 
my program //cents #include <iostream> using std::cout; using std::cin; using std::endl; #include <conio.h> int main () { double ...
[3 replies] Last: thanks a lot.. now my program is all alright.. (by deviant)
Stuck on Code for Program
 
I cleaned up my code so it is easier to read. I am having difficulties with the allocation of employee in my code. When I run the program, I can get the head...
[4 replies] Last: The file is employee name, pay status, hours worked per week and hourl... (by LostStudent)
how to read hexadecimal data
 
If somebody can tell me how to read hexadecimal and octal data. With Regards, Matanuragi
[3 replies] Last: How is the input formatted. As bytes? 01 7F 13 AB A5 0C ... or as ... (by Duthomhas)
Word Reverse in C++. What to use?
 
I was given a program to think about: To read in a 4 word sentence from the keyboard then display it backwards (in terms of the words, not the letters) I th...
[3 replies] Last: Yep. You got it exactly! ;-) You'll need another loop where ? ... (by Duthomhas)
July 2008 Pages: 1... 7891011... 15
  Archived months: [jun2008] [aug2008]

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