Recommend
 
 Thumb up
 Hide
6 Posts

BoardGameGeek» Forums » Everything Else » Chit Chat

Subject: c++ tutorials and lessons rss

Your Tags: Add tags
Popular Tags: [View All]
vurdlak vurdlakovic
Croatia
flag msg tools
I started wrting c lessons for absoulute begginers to advanced users, I think material can be considered quality, and my students learn programming with this stuff. If you wish feel free to start reading it.Its only 8 lessons for now so maybe could be easier for you to start following it now in the beginning. Hope I helped..materials will be published on daily base. Enjoy now, or later when I reach more advanced topics...

Also if you come across mistakes please comment them. thnks
--------------------------------------------------------------
http://www.visualcmaniac.com
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
vurdlak vurdlakovic
Croatia
flag msg tools
can someone help me how to format my code so it doens all come up like this with no spaces and tabs? i use blogger. thank you!

if (d > 0)
{
/* results are real numbers */
q = pow (d, 1./2);
x1 = (-b + q)/(2*a);
x2 = (-b - q)/(2*a);
printf ("X1=%f X2=%f\n", x1, x2);
}
else if (d == 0)
{
/* there’s only one result */
x1 = -b/(2*a);
printf ("X1=X2=%f\n", x1);
}
else
{
/* results are conjugated complex numbers */
q = pow(-d, 1./2);
x1r = -b/(2*a) ;
x2r = x1r;
x1i = q/(2*a);
x2i = -x1i;
printf ("X1 = (%f,%f)\n", x1r, x1i);
printf ("X2 = (%f,%f)\n", x2r, x2i);
}
}

--------------------------------------------------------------
http://www.visualcmaniac.com
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Jorge Montero
United States
St Louis
Missouri
flag msg tools
badge
I'll take Manhattan in a garbage bag. With Latin written on it that says "It's hard to give a shit these days"
Avatar
mbmbmbmbmb
most forums, including this one, have a Code tag of some sort that will let you do what you want:


void whatever(){
if (d > 0)
{
/* results are real numbers */
q = pow (d, 1./2);
x1 = (-b + q)/(2*a);
x2 = (-b - q)/(2*a);
printf ("X1=%f X2=%f\n", x1, x2);
}
else if (d == 0)
{
/* there’s only one result */
x1 = -b/(2*a);
printf ("X1=X2=%f\n", x1);
}
else
{
/* results are conjugated complex numbers */
q = pow(-d, 1./2);
x1r = -b/(2*a) ;
x2r = x1r;
x1i = q/(2*a);
x2i = -x1i;
printf ("X1 = (%f,%f)\n", x1r, x1i);
printf ("X2 = (%f,%f)\n", x2r, x2i);
}
}
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Virre Linwendil Annergård
Sweden
Stockholm
flag msg tools
Forza Bajen!
badge
... and still sober
Avatar
mbmbmbmbmb
allthough he said he wanted to get it formated at blogger, but I know there is at least two ways to fix this, my memory isn't working at the moment. But someone else I hope will be able to tell him to fix this?
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Stephen Tavener
United Kingdom
London
England
flag msg tools
designer
The overtext below is true.
badge
The overtext above is false.
Avatar
mbmbmbmbmb
I hope you draw heavily on the wonderful examples here:

http://www0.us.ioccc.org/years.html

... and your puzzle for the day:

unsigned short whatever(unsigned long N)
{
unsigned long u2 = 0, u = 0, d;
int l2;

for (l2 = 15; l2 >= 0; l2--) if (u2 + (d=(u<<(l2+1)) + (1L<<(l2<<1))) <= N) { u2 += d; u += (1L<<l2); }

return (unsigned short)u;
}
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
vurdlak vurdlakovic
Croatia
flag msg tools
solved it few days ago using PRE tags
 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Front Page | Welcome | Contact | Privacy Policy | Terms of Service | Advertise | Support BGG | Feeds RSS
Geekdo, BoardGameGeek, the Geekdo logo, and the BoardGameGeek logo are trademarks of BoardGameGeek, LLC.