Search Results

Showing results 1 to 10 of 10
Search took 0.01 seconds.
Search: Posts Made By: firstPerson ; Forum: C and child forums
Forum: C 9 Days Ago
Replies: 7
Views: 269
Posted By firstPerson
>>But this looks ugly and I had to use a separate variable.

I think that looks beautiful. In fact you can just make a function that does that, and so it will be in a sense a one liner.

I don't...
Forum: C 15 Days Ago
Replies: 3
Views: 356
Posted By firstPerson
You need to do a little more :


int LoadBitmap(const char* filename)
{
GLubyte* pixels;
HBITMAP hbmp;
BITMAP bmp;
GLuint size;
GLenum format;
Forum: C 19 Days Ago
Replies: 1
Views: 322
Posted By firstPerson
don't use the sqrt function. compare the squared distance.
Forum: C Oct 16th, 2009
Replies: 5
Views: 299
Posted By firstPerson
Haven't tested it yet, but it could be similar to this :


int M = 5;
int i = 1;
while(i <= M) cout << i++ <<" "; //print from 1 to 5
while(--i > 0) cout << i << " "; //print from 4 to 1
Forum: C Sep 18th, 2009
Replies: 11
Views: 422
Posted By firstPerson
Yes, structure goes by units of 4.
Forum: C Sep 18th, 2009
Replies: 8
Views: 592
Posted By firstPerson
int cnt = 0;

for infinite loop
{
//do stuff
if(//do stuff is what i need) // then break;
else cnt++;

//if cnt is above the limit then break;
}
Forum: C Sep 17th, 2009
Replies: 17
Views: 572
Posted By firstPerson
sizeof(array)/sizeof(double) ?
Forum: C Sep 14th, 2009
Replies: 8
Views: 677
Posted By firstPerson
Have a left, middle, and end variable. Make middle static.

Move left up 1, move end down 1. If left == mid || right == mid then stop.
Forum: C Aug 28th, 2009
Replies: 4
Views: 349
Posted By firstPerson
I think what you are looking for is something like this :


char *twoDee[][3] = {{"item1", "1", "1"}, {"item2", "1", "2"}};


You need to supply the column before hand.
Thus the code :
...
Forum: C Aug 18th, 2009
Replies: 22
Views: 1,131
Posted By firstPerson
Here is another way you might want to try. Its in c++ though.
You could try to convert it into c.



float GetFloat()
{
std::cout<<"Enter a number please : ";
float num(0);
cin >> num;
Showing results 1 to 10 of 10

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC