Solved

OpenGL programming question

Posted on 2000-03-30
20
562 Views
Last Modified: 2008-02-01
I am trying to right a program where I draw a sphere and then I can draw points on the sphere.  My code for finding the 'z' component doesnt seem to be working.  Any suggestions please.

Here is my code:

#include <windows.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glut.h>
#define TRUE 1
#define FALSE 0
#define SIZE 20


void chngDimensions(int value);
float getZval(int x, int y);
void DrawVertices(void);

int increase = 10;
int decrease = -10;
float r = 1.0;
int solid = TRUE;
float points [SIZE][3];   /*store all current points drawn*/
int numPoints;  /*store the number of points drawn thus far*/
int winH, winW;


void myinit(void)
{
    GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
    GLfloat mat_shininess[] = { 50.0 };
    GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0 };

    glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
    glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
    glLightfv(GL_LIGHT0, GL_POSITION, light_position);

    glEnable(GL_LIGHTING);
    glEnable(GL_LIGHT0);
    glDepthFunc(GL_LEQUAL);
    glEnable(GL_DEPTH_TEST);
}

void display(void){
      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
   glMatrixMode(GL_MODELVIEW);
   glLoadIdentity();
   if(solid == TRUE)
         glutSolidSphere(r, 50, 40);
   else
         glutWireSphere(r, 50, 40);
   DrawVertices();
   glutSwapBuffers();
}

void myReshape(int w, int h){
      winW = w;
   winH = h;
   glViewport(0, 0, w, h);
   glMatrixMode(GL_PROJECTION);
   glLoadIdentity();
   if (w <= h)
         glOrtho (-1.5, 1.5, -1.5*(GLfloat)h/(GLfloat)w,
            1.5*(GLfloat)h/(GLfloat)w, -10.0, 10.0);
   else
         glOrtho (-1.5*(GLfloat)w/(GLfloat)h,
            1.5*(GLfloat)w/(GLfloat)h, -1.5, 1.5, -10.0, 10.0);
   glMatrixMode(GL_MODELVIEW);
   glLoadIdentity();
   display();
}


void mouse(int button, int state, int x, int y){
      int valid; float z;
      if(button==GLUT_LEFT_BUTTON && state==GLUT_DOWN){
         y = winH - y;
      valid = onSphere(x,y);
      if(valid == TRUE){
            z = getZval(x,y);
            points[numPoints][0] = x;
            points[numPoints][1] = y;
         points[numPoints][2] = -z;
            numPoints = numPoints + 1;
         glutPostRedisplay();
            }
      else
            return;
      }
   else if(button==GLUT_MIDDLE_BUTTON && state==GLUT_DOWN){
         chngDimensions(increase);
      glutPostRedisplay();
      }
   else if(button==GLUT_RIGHT_BUTTON && state==GLUT_DOWN){
         chngDimensions(decrease);
      glutPostRedisplay();
      }
   }

void DrawVertices(void){
    int i;
       glColor3f(1.0, 0.0, 0.0);
    glBegin(GL_POINTS);
             for(i=0;i<numPoints;i++)
                glVertex3f(points[i][0],points[i][1],points[i][2]);
    glEnd();
}

void keyboard(unsigned char key,int x,int y){
      if(key == 's' || 'S')
         solid = !solid;
   glutPostRedisplay();
   }

int onSphere(int x, int y){
      double temp;
   temp = (x-winW/2)*(x-winW/2) + (y-winH/2)*(y-winH/2);
   if(temp <= ((winW/3)*(winW/3)))
         return TRUE;
   else
         return FALSE;
   }


void chngDimensions(int value){
      int i;
      if(value == increase){
         r = r * 1.1;
         for(i=0; i++; i<=numPoints){
            points[i][0] = points[i][0]*1.1;
         points[i][1] = points[i][1]*1.1;
         points[i][2] = points[i][2]*1.1;
         }
      }
   else{
         r = r * .9;
         for(i=0; i++; i<=numPoints){
            points[i][0] = points[i][0]*.9;
         points[i][1] = points[i][1]*.9;
         points[i][2] = points[i][2]*.9;
         }
      }
   glutPostRedisplay();
   }


float getZval(int x, int y){
      float z;
   z = (winW/3)*(winW/3) - (x-winW/2)*(x-winW/2) - (y-winH/2)*(y-winH/2);
   z = sqrt(z);
   return z;
   }


int main(int argc, char** argv)
{
    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
    glutInitWindowSize(500,500);
    glutCreateWindow("Sphere Program");
    myinit();
    glutReshapeFunc(myReshape);
    glutMouseFunc(mouse);
    glutKeyboardFunc(keyboard);
    glutDisplayFunc(display);
    glutMainLoop();
}


0
Comment
Question by:AzraSound
  • 12
  • 8
20 Comments
 
LVL 1

Expert Comment

by:ntdragon
ID: 2672863
first try to:
//your func
float getZval(int x, int y){
float z;
   z = (winW/3)*(winW/3) - (x-winW/2)*(x-winW/2) - (y-winH/2)*(y-winH/2);
   z = sqrt(z);
   return z;
}
the parameters winW,winH,x,y are all int's so when you div them you get a round answre so fist try to make them
float's like z

<p.s when you writeing in openGL you u usually use the openGL parameters GLint
GLfloat GLdouble>

if it still didn't solve your problem
explaine it more carefully

0
 
LVL 28

Author Comment

by:AzraSound
ID: 2673759
How do I do that when the x and y passed to the function are from the glutMouseFunc which by default returns x and y as int?
0
 
LVL 1

Accepted Solution

by:
ntdragon earned 75 total points
ID: 2674255
then you can use casting
or make another parameters in your func

//your func
float getZval(int x, int y){
float z;
   z = (winW/3)*(winW/3) - (x-winW/2)*(x-winW/2) - (y-winH/2)*(y-winH/2);
   z = sqrt(z);
   return z;
}

1)
//your func
float getZval(int x, int y){
float z;
   z = (float(winW/3))*(flost(winW/3)) - (flost(x-flost(winW/2)))*(flost(x-float(winW/2))) - (flost(y)-flost(winH/2))*(float(y-flost(winH/2)));
   z = sqrt(z);
   return z;
}
i hope i didn't forget any casting

2)
//your func
float getZval(int x, int y){
float z;
float xx=x;
float yy=y;
float winw=winW;
float winh=winH;
   z = (winw/3)*(winw/3) - (xx-winww/2)*(xx-winww/2) - (yy-winh/2)*(yy-winh/2);
   z = sqrt(z);
   return z;
}
 
i hope it will help
<if you tried the first and it didn't work try the second 'cause maybe i forget a casting in the first>

if it still didn't solve your prob tell me and i"ll check your code again
0
 
LVL 28

Author Comment

by:AzraSound
ID: 2674267
i still dont see how that would change anything b/c x and y are still passed to the function as integers.  I tried it anyways but it didnt work.  Perhaps I am not calculating the z coordinate correctly.  All I want to be able to do is draw a visible point on the sphere. When the user clicks the left mouse button i need to calculate the appropriate z coordinate value at that point that would draw a point on the spheres surface.
0
 
LVL 1

Expert Comment

by:ntdragon
ID: 2674380
i don't see why you should calculate the z coordinate for that

if the nearest z coordinate of the
sphere is z1
draw all the points z=z1+0.01;
and make glEnable(DEPTH_TEST);
if i rememer right the func

about what i told you befor the problem is

when you have to int's
int i=7;
int j=2;
then i/j=3 and not 3.5 becouse they both int's so the divition should be int too
0
 
LVL 28

Author Comment

by:AzraSound
ID: 2674413
i dont need to calculate the z coordinate??  I would have to, the z coordinate is very different from if they click on the part of the sphere closest to them as opposed to clicking on the sphere towards its top.  if the sphere were centered at (0,0,0) then clicking on the sphere in the middle would be pretty much a distance equal to the radius. However clicking near the tip of the sphere should produce a point with a z coordinate close to 0.
0
 
LVL 1

Expert Comment

by:ntdragon
ID: 2675963
first i don't think that you will see much difrence you sphear radius is 1
so if you"ll draw all the points at r+0.1 i don't think it will that bad

but ok as you wish i"ll try to check you calculations

maybe i didn't understand what you tried
to do but i think that you are wrong
you try to use it as a circul not a sphear

(x-a)^2+(y-a)^2=r^2
it's for circul

i don't remember the right one for sphear







0
 
LVL 1

Expert Comment

by:ntdragon
ID: 2675987
oh maybe you are right
what is the 'z' coordinate of your sphear?
try first to change all to floats as i told you
and instead of doing z=sqrt(z)
do z=sqrt(z)+0.1;
'cause maybe you have a problem with drawing a pixel on the sphear so try to draw it a little bit nearer

if it won't work then try to draw a square instead of a point to check your comp there are display cards that doesn't work well with openGL and may 'cause the problem
0
 
LVL 28

Author Comment

by:AzraSound
ID: 2676354
perhaps that is the problem. I will try it on my friends SGI workstation tomorrow and let you know if maybe thats the problem.
0
 
LVL 28

Author Comment

by:AzraSound
ID: 2676657
i have one question though, increasing it by .1 wont do it i dont think.  when i call the mouse function, the x and y return the pixel position values so they could be like x = 350 and y = 280 even though my sphere is of radius 1. so i use those numbers to get my z so my z is very large as well.  is this incorrect?  this is rather urgent.  if you solve it i will double the points.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Expert Comment

by:ntdragon
ID: 2676746
you don't have double points i'm answering in EE only becouse it interesting the point are at second place so if i can i"ll help you and maybe someday you"ll help me

i think i sloved your prob
first check this code


#pragma hdrstop
#include <condefs.h>


//---------------------------------------------------------------------------
#pragma argsused
#include <windows.h>
#include <iostream.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glut.h>
#define TRUE 1
#define FALSE 0
#define SIZE 20


void chngDimensions(int value);
float getZval(int x, int y);
void DrawVertices(void);

int increase = 10;
int decrease = -10;
float r = 1.0;
int solid = TRUE;
float points [SIZE][3];   /*store all current points drawn*/
int numPoints;  /*store the number of points drawn thus far*/
int winH, winW;

int onSphere(int x, int y){
double temp;
   temp = (x-winW/2)*(x-winW/2) + (y-winH/2)*(y-winH/2);
   if(temp <= ((winW/3)*(winW/3)))
    return TRUE;
   else
    return FALSE;
   }

void myinit(void)
{
    GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
    GLfloat mat_shininess[] = { 50.0 };
    GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0 };

    glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
    glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
    glLightfv(GL_LIGHT0, GL_POSITION, light_position);

    glEnable(GL_LIGHTING);
    glEnable(GL_LIGHT0);
    glDepthFunc(GL_LEQUAL);
    glEnable(GL_DEPTH_TEST);
}
void DrawVertices(void){
    int i;
glColor3f(1, 0,0);
    glBegin(GL_POLYGON);
     glVertex3f(0.1,0.1,1);
     glVertex3f(-0.1,0.1,1);
     glVertex3f(-0.1,-0.1,1);
     glVertex3f(0.1,-0.1,1);

   /*
    for(i=0;i<numPoints;i++){
     glVertex3f(points[i][0],points[i][1],points[i][2]);
     cout<<'('<<points[i][0]<<','<<points[i][1]<<','<<points[i][2]<<")\n\n";
     }
     */
    glEnd();
}

void display(void){
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
   glMatrixMode(GL_MODELVIEW);
   glLoadIdentity();
   if(solid == TRUE)
    glutSolidSphere(r, 50, 40);
   else
    glutWireSphere(r, 50, 40);
   DrawVertices();
   glutSwapBuffers();
}

void myReshape(int w, int h){
winW = w;
   winH = h;
   glViewport(0, 0, w, h);
   glMatrixMode(GL_PROJECTION);
   glLoadIdentity();
   if (w <= h)
    glOrtho (-1.5, 1.5, -1.5*(GLfloat)h/(GLfloat)w,
       1.5*(GLfloat)h/(GLfloat)w, -10.0, 10.0);
   else
    glOrtho (-1.5*(GLfloat)w/(GLfloat)h,
       1.5*(GLfloat)w/(GLfloat)h, -1.5, 1.5, -10.0, 10.0);
   glMatrixMode(GL_MODELVIEW);
   glLoadIdentity();
   display();
}


void mouse(int button, int state, int x, int y){
int valid; float z;
if(button==GLUT_LEFT_BUTTON && state==GLUT_DOWN){
    y = winH - y;
      valid = onSphere(x,y);
      if(valid == TRUE){
       z = getZval(x,y);
       points[numPoints][0] = x;
       points[numPoints][1] = y;
         points[numPoints][2] = -z;
       numPoints = numPoints + 1;
         glutPostRedisplay();
       }
      else
       return;
      }
   else if(button==GLUT_MIDDLE_BUTTON && state==GLUT_DOWN){
    chngDimensions(increase);
      glutPostRedisplay();
      }
   else if(button==GLUT_RIGHT_BUTTON && state==GLUT_DOWN){
    chngDimensions(decrease);
      glutPostRedisplay();
      }
   }



void keyboard(unsigned char key,int x,int y){
if(key == 's' || 'S')
    solid = !solid;
   glutPostRedisplay();
   }

void chngDimensions(int value){
int i;
if(value == increase){
    r = r * 1.1;
    for(i=0; i++; i<=numPoints){
       points[i][0] = points[i][0]*1.1;
         points[i][1] = points[i][1]*1.1;
         points[i][2] = points[i][2]*1.1;
         }
      }
   else{
    r = r * .9;
    for(i=0; i++; i<=numPoints){
       points[i][0] = points[i][0]*.9;
         points[i][1] = points[i][1]*.9;
         points[i][2] = points[i][2]*.9;
         }
      }
   glutPostRedisplay();
   }


float getZval(int x, int y){
float z;
   z = (winW/3)*(winW/3) - (x-winW/2)*(x-winW/2) - (y-winH/2)*(y-winH/2);
   z = sqrt(z)+1;
   return z;
   }


int main(int argc, char** argv)
{
    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
    glutInitWindowSize(500,500);
    glutCreateWindow("Sphere Program");
    myinit();
    glutReshapeFunc(myReshape);
    glutMouseFunc(mouse);
    glutKeyboardFunc(keyboard);
    glutDisplayFunc(display);
    glutMainLoop();
}

here you"ll see that it draw's but only in gray <i think it's becouse the light
remove it and check it the square will be red> so even if you'll draw the point you won't see gray point on gray shpear

then check this code check the cout

#pragma hdrstop
#include <condefs.h>


//---------------------------------------------------------------------------
#pragma argsused
#include <windows.h>
#include <iostream.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glut.h>
#define TRUE 1
#define FALSE 0
#define SIZE 20


void chngDimensions(int value);
float getZval(int x, int y);
void DrawVertices(void);

int increase = 10;
int decrease = -10;
float r = 1.0;
int solid = TRUE;
float points [SIZE][3];   /*store all current points drawn*/
int numPoints;  /*store the number of points drawn thus far*/
int winH, winW;

int onSphere(int x, int y){
double temp;
   temp = (x-winW/2)*(x-winW/2) + (y-winH/2)*(y-winH/2);
   if(temp <= ((winW/3)*(winW/3)))
    return TRUE;
   else
    return FALSE;
   }

void myinit(void)
{
    GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
    GLfloat mat_shininess[] = { 50.0 };
    GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0 };

    glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
    glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
    glLightfv(GL_LIGHT0, GL_POSITION, light_position);

    glEnable(GL_LIGHTING);
    glEnable(GL_LIGHT0);
    glDepthFunc(GL_LEQUAL);
    glEnable(GL_DEPTH_TEST);
}
void DrawVertices(void){
    int i;
glColor3f(1, 0,0);
    glBegin(GL_POINT);

    for(i=0;i<numPoints;i++){
     glVertex3f(points[i][0],points[i][1],points[i][2]);
     cout<<'('<<points[i][0]<<','<<points[i][1]<<','<<points[i][2]<<")\n\n";
     }
    glEnd();
}

void display(void){
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
   glMatrixMode(GL_MODELVIEW);
   glLoadIdentity();
   if(solid == TRUE)
    glutSolidSphere(r, 50, 40);
   else
    glutWireSphere(r, 50, 40);
   DrawVertices();
   glutSwapBuffers();
}

void myReshape(int w, int h){
winW = w;
   winH = h;
   glViewport(0, 0, w, h);
   glMatrixMode(GL_PROJECTION);
   glLoadIdentity();
   if (w <= h)
    glOrtho (-1.5, 1.5, -1.5*(GLfloat)h/(GLfloat)w,
       1.5*(GLfloat)h/(GLfloat)w, -10.0, 10.0);
   else
    glOrtho (-1.5*(GLfloat)w/(GLfloat)h,
       1.5*(GLfloat)w/(GLfloat)h, -1.5, 1.5, -10.0, 10.0);
   glMatrixMode(GL_MODELVIEW);
   glLoadIdentity();
   display();
}


void mouse(int button, int state, int x, int y){
int valid; float z;
if(button==GLUT_LEFT_BUTTON && state==GLUT_DOWN){
    y = winH - y;
      valid = onSphere(x,y);
      if(valid == TRUE){
       z = getZval(x,y);
       points[numPoints][0] = x;
       points[numPoints][1] = y;
         points[numPoints][2] = -z;
       numPoints = numPoints + 1;
         glutPostRedisplay();
       }
      else
       return;
      }
   else if(button==GLUT_MIDDLE_BUTTON && state==GLUT_DOWN){
    chngDimensions(increase);
      glutPostRedisplay();
      }
   else if(button==GLUT_RIGHT_BUTTON && state==GLUT_DOWN){
    chngDimensions(decrease);
      glutPostRedisplay();
      }
   }



void keyboard(unsigned char key,int x,int y){
if(key == 's' || 'S')
    solid = !solid;
   glutPostRedisplay();
   }

void chngDimensions(int value){
int i;
if(value == increase){
    r = r * 1.1;
    for(i=0; i++; i<=numPoints){
       points[i][0] = points[i][0]*1.1;
         points[i][1] = points[i][1]*1.1;
         points[i][2] = points[i][2]*1.1;
         }
      }
   else{
    r = r * .9;
    for(i=0; i++; i<=numPoints){
       points[i][0] = points[i][0]*.9;
         points[i][1] = points[i][1]*.9;
         points[i][2] = points[i][2]*.9;
         }
      }
   glutPostRedisplay();
   }


float getZval(int x, int y){
float z;
   z = (winW/3)*(winW/3) - (x-winW/2)*(x-winW/2) - (y-winH/2)*(y-winH/2);
   z = sqrt(z)+1;
   return z;
   }


int main(int argc, char** argv)
{
    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
    glutInitWindowSize(500,500);
    glutCreateWindow("Sphere Program");
    myinit();
    glutReshapeFunc(myReshape);
    glutMouseFunc(mouse);
    glutKeyboardFunc(keyboard);
    glutDisplayFunc(display);
    glutMainLoop();
}

here you can see that the point coordinates are too big 'cause as you saw in the first example i used coordinates like ( 0.1, 0.1, 1 )
and your point's coordinates are something like (100+,100+,-90-) so the point isn't on the sphear and not even in the window












0
 
LVL 28

Author Comment

by:AzraSound
ID: 2676789
i forgot to mention that this must be in c and not c++.  i dont know anything about c++ really.  i tried your first code and i got errors about condefs.h and iostream.h so i took them out. when i ran the program it drew a black square right on the middle of the sphere.  is that correct?  
0
 
LVL 28

Author Comment

by:AzraSound
ID: 2676794
so i cant use your second code because it uses cout..isnt that like printf in c??
0
 
LVL 28

Author Comment

by:AzraSound
ID: 2676799
hmmm...i changed the cout to printf and i would get output numbers like this:

0  183892838 0
0  183239294 0

etc.  

0 for x,z and a ridiculously huge # for y

I'm more confused than i was before   =/
0
 
LVL 1

Expert Comment

by:ntdragon
ID: 2677436
i'm not at home right now so i can't check it now

but first try to check you x,y coordinates when you click the mouse
<using printf>
and then check the point's coordinate i mean how you set them

second in the first example you can remove those header files
and what i want to show you is that it draws a square in gray not in red
so even if the coordinates of the point will be right you won't see it becouse of the color<try to remove the light>

i"ll get home i"ll try to play with you code again
0
 
LVL 28

Author Comment

by:AzraSound
ID: 2677810
can i make the sphere red then and have the points be grey?? btw, the glutMouseFunc returns the x,y coordinates and if i do a debug on the program the x and y coordinates are always like (300, 275) for example.  It returns I believe the x,y position from the bottom left corner of the window I created.
0
 
LVL 28

Author Comment

by:AzraSound
ID: 2677838
changes I made to make the sphere more visible:

the new myinit function,

void myinit(void)
{
    //GLfloat mat_specular[] = { 1.0, 0.0, 1.0, 1.0 };
    GLfloat mat_shininess[] = { 30.0 };
    //GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0 };
    GLfloat light_diffuse[] = {1.0, 0.0, 0.0, 1.0};
    GLfloat light_ambient[] = {1.0, 1.0, 1.0, 1.0};
   

    //glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
    glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
    //glLightfv(GL_LIGHT0, GL_POSITION, light_position);
    glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
    glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);

    glEnable(GL_LIGHTING);
    glEnable(GL_LIGHT0);
    glDepthFunc(GL_LEQUAL);
    glEnable(GL_DEPTH_TEST);
}
0
 
LVL 1

Expert Comment

by:ntdragon
ID: 2678083
did you do a red sphear???
'cause i think you won't be able to do that becouse of the light

about the x,y coordinates i think it becouse the mouse func give you coordinates dipending on your window
(500,500)=(w,h)
try to use
(x0,y0) instead of (x,y)
x0=-1.5+x/w;
y0=1.5-y/h;
i'm not sure it will work but try it

btw first remove the light from the prog when it will work without light then try to put it back
0
 
LVL 28

Author Comment

by:AzraSound
ID: 2678097
i made my light red which made the sphere red
and i dont understand what you are trying to do with the x0 and y0
do i pass that to my onSphere and getzval functions???

i still dont see why i cant just draw a point on the sphere regardless of how the light is
0
 
LVL 28

Author Comment

by:AzraSound
ID: 2678591
Well I got it working.  What I had to do was convert the pixel position values I was getting into values that drawing on the sphere could understand.  You were right about floating point values however.  Thanks for all your input.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now