09-21-2008
My output doesn't match anything...and the program is pretty simple
This is what I have:
#include <stdio.h>
int main (void)
{
int integerVar;
int floatingVar;
int doubleVar;
int charVar;
integerVar = 100;
floatingVar = 331.79;
doubleVar = 8.44e+11;
charVar = 'W';
_Bool boolVar;
boolVar = 0;
printf ("integerVar = %i\n", integerVar);
printf ("floatingVar = %f\n", floatingVar);
printf ("doubleVar = %e\n", doubleVar);
printf ("doubleVar = %g\n", doubleVar);
printf ("charVar = %c\n", charVar);
printf ("boolVar = %i\n", boolVar);
return 0;
}
And this is what I got:
integerVar = 100
floatingVar = 0.000000
doubleVar = 6.674375e-308
doubleVar = 6.67437e-308
charVar = W
boolVar = 0
I don't know why the floatingVar and doubleVar's don't work. Does anybody know why this is?
I'm supposed to get:
integarVar = 100
floatingVar = 331.790009
doubleVar = 8.440000e+11
doubleVar = 8.44e+11
charVar = W
boolVar = 0
-- I'm using something I have never used before about a week ago, a program called Dev-C++ to write and compile and I'm using Command Prompt's bash to run it.
If anybody can figure out why I can't compile and run through Dev-C++, that would also be very helpful.
Last edited by pwanda; 09-21-2008 at 08:28 PM..
Reason: Forgot what program output is supposed to look like.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hey guys....
couple questions...
I am working a problem set and can't answer this:
1) Suppose you are in a directory that contains a file called "foo." You want to create a new file called "bar" that contains the sorted contents of "foo" in the parent directory of the one you're in. How... (8 Replies)
Discussion started by: ugakid
8 Replies
2. UNIX for Dummies Questions & Answers
This is on a Solaris 9 box, but I feel like a noob, so I am posting here. When I echo $PATH I get a lot of duplicate paths and extra stuff I don't need. What I want is just what I set up in my home dir under .profile
My login shell=/bin/bash
I checked the following and there are no path... (1 Reply)
Discussion started by: Veestan
1 Replies
3. Shell Programming and Scripting
Hi folksSorry if code tags don't work out correctly but this PC does not have Java setup correctly to allow me to put them inproperly.I have a simple string pattern match behaving differntly on AIX and Solaris 10 and I don't understand why or what to do about it.This simple test: -) ]] && echo... (4 Replies)
Discussion started by: steadyonabix
4 Replies
4. Shell Programming and Scripting
I'm pretty experienced with regexps, but I just can't get this expression to work.
The first line of my test file is this:
**** info Fri Jun 04 12:37:58 PDT 2010 stuff
I'm piping this file into this:
egrep '^****\s++*Fri Jun 04'
This returns 0 lines.
If I change the... (7 Replies)
Discussion started by: dkarr
7 Replies
5. Shell Programming and Scripting
Hello !
Experts, I saw a ton of postings here about Awk pattern matching and even after going through all of it, what I have concocted isnt working for me.
Here is what I am after.
I have a huge set of csv files and in the fifth column, I have text like this ---
ANFD10239CS9
BCDD93948CS9... (5 Replies)
Discussion started by: PG3
5 Replies
6. Solaris
Hi, I got the following errors during zfs resource pool configuration. Please help. Thanks.
# svcs *pool*
svcs: Pattern 'pooladm.conf' doesn't match any instances
STATE STIME FMRI
# svcadm enable system/pools:default
# svcs *pool*
svcs: Pattern 'pooladm.conf' doesn't match any... (4 Replies)
Discussion started by: aixlover
4 Replies
7. Shell Programming and Scripting
Its rather confusing, the output of top command is below:
The "swap" field of top is described by the manpage as: "The swapped out portion of a task's total virtual memory image."
But the output of free command suggests something else and it does tally with the output of swapon... (3 Replies)
Discussion started by: proactiveaditya
3 Replies
8. Linux
I'm loged on server A as user infa8. I want to login via ssh key on server B as user ussdsc.
destination server (B) is a redHat 6.2.
Permissions for ussdsc@B for home, ssh and authorized_keys:
$ ls -ltr | grep ussdsc
drwxr-xr-x. 29 ussdsc mobifon 4096 Feb 18 11:43 ussdsc
$ getfacl... (8 Replies)
Discussion started by: black_fender
8 Replies
9. Shell Programming and Scripting
In the example below i would want the extensions to match.
Is there any other utility or script to achieve this. Kindly help.
Example:
sdiff sourceFileNames targetFileNames
17021701P.blf | 17021901P.ibk
17021701P.chn | 17021901P.irk
17021701P.bmr | 17021901P.dyd
17021701P.dpf |... (7 Replies)
Discussion started by: jamilpasha
7 Replies
10. Red Hat
Can somebody know if it is possible to connect to remote IBM MQ, if local server using C, but don't have MQ library?
Thanks for contribution (0 Replies)
Discussion started by: digioleg54
0 Replies
LEARN ABOUT OSX
glutinitwindowposition
glutInitWindowPosition(3GLUT) GLUT glutInitWindowPosition(3GLUT)
NAME
glutInitWindowPositionWindowPosition, glutInitWindowSize - set the initial window position and size respectively.
SYNTAX
#include <GLUT/glut.h>
void glutInitWindowSize(int width, int height);
void glutInitWindowPosition(int x, int y);
ARGUMENTS
width Width in pixels.
height Height in pixels.
x Window X location in pixels.
y Window Y location in pixels.
DESCRIPTION
Windows created by glutCreateWindow will be requested to be created with the current initial window position and size.
The initial value of the initial window position GLUT state is -1 and -1. If either the X or Y component to the initial window position is
negative, the actual window position is left to the window system to determine. The initial value of the initial window size GLUT state is
300 by 300. The initial window size components must be greater than zero.
The intent of the initial window position and size values is to provide a suggestion to the window system for a window's initial size and
position. The window system is not obligated to use this information. Therefore, GLUT programs should not assume the window was created at
the specified size or position. A GLUT program should use the window's reshape callback to determine the true size of the window.
EXAMPLE
If you would like your GLUT program to default to starting at a given screen location and at a given size, but you would also like to let
the user override these defaults via a command line argument (such as -geometry for X11), call glutInitWindowSize and glutInitWindowPosi-
tion before your call to glutInit. For example:
int main(int argc, char **argv)
{
glutInitWindowSize(500, 300);
glutInitWindowPosition(100, 100);
glutInit(&argc, argv);
...
}
However, if you'd like to force your program to start up at a given size, call glutInitWindowSize and glutInitWindowPosition after your
call to glutInit. For example:
int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitWindowSize(500, 300);
glutInitWindowPosition(100, 100);
...
}
SEE ALSO
glutInit, glutCreateWindow, glutCreateSubWindow, glutReshapeFunc, glutGet
AUTHOR
Mark J. Kilgard (mjk@nvidia.com)
GLUT
3.7 glutInitWindowPosition(3GLUT)