Author Topic: C, C++ and C# tutorials  (Read 626 times)

0 Members and 1 Guest are viewing this topic.

Offline Сєşάя

  • *****
  • Posts: 631
  • Gender: Male
  • I used to be annoying
  • Respect: +72
Re: C, C++ and C# tutorials
« Reply #30 on: October 08, 2011, 10:19:41 AM »
0
I bought my C book last month, very good book, I know now how to manipulate strings:

char name[256];

printf("Tell me your name: ");
scanf("%s", name);
printf("Hello %s", name);

Offline Travelsonic

  • *****
  • Posts: 743
  • We're gonna need a new obstacle course...
  • Respect: +78
Re: C, C++ and C# tutorials
« Reply #31 on: October 23, 2011, 09:27:48 AM »
0
One thing I'd get proficient in is dynamic memory allocation -> that way you aren't creating containers that waste space since the unknown of how much space you needs is currently forcing you to create containers or variables that take up more space than what may be needed.
lim ( Δ :trollface: -> 0 ) (:trollface: + Δ :trollface:)² + :trollface: = :trollface:

Offline ursus

  • ***
  • Linux UserCat LoverWindows UserOld Forum Member
    View More Badges!

  • Posts: 4393
  • Gender: Male
  • drunkposting is the music of the soul
  • Respect: +1518
Re: C, C++ and C# tutorials
« Reply #32 on: October 24, 2011, 04:15:39 PM »
0
I bought my C book last month, very good book, I know now how to manipulate strings:

char name[256];

printf("Tell me your name: ");
scanf("%s", name);
printf("Hello %s", name);


wouldn't str name make more sense?

Offline Tomcat

  • Your Argument is Inert
  • ******
  • Donator
    View More Badges!

  • Posts: 2539
  • Gender: Male
  • Wat Do?
  • Respect: +503
    • Tomcat's blog
Re: C, C++ and C# tutorials
« Reply #33 on: October 24, 2011, 05:25:50 PM »
0
wouldn't str name make more sense?

doesnt rly matter

but yes

Offline Travelsonic

  • *****
  • Posts: 743
  • We're gonna need a new obstacle course...
  • Respect: +78
Re: C, C++ and C# tutorials
« Reply #34 on: October 24, 2011, 07:01:35 PM »
0
doesnt rly matter

but yes

Depends - I mean, yes, it is an array of character arrays - which usually makes up a string, but at the same time the variable name makes the programmer perfectly aware of its intended use, I guess.  nameStr, IMO, would be best - the name gives it away as an array of characters [acting as a string] that stores someone's name.  :D
lim ( Δ :trollface: -> 0 ) (:trollface: + Δ :trollface:)² + :trollface: = :trollface:

Offline ursus

  • ***
  • Linux UserCat LoverWindows UserOld Forum Member
    View More Badges!

  • Posts: 4393
  • Gender: Male
  • drunkposting is the music of the soul
  • Respect: +1518
Re: C, C++ and C# tutorials
« Reply #35 on: October 25, 2011, 09:57:57 PM »
0
Depends - I mean, yes, it is an array of character arrays - which usually makes up a string, but at the same time the variable name makes the programmer perfectly aware of its intended use, I guess.  nameStr, IMO, would be best - the name gives it away as an array of characters [acting as a string] that stores someone's name.  :D

yo dawg we herd u liek arrays so we put arrays in your array so you can array while you array

Offline Travelsonic

  • *****
  • Posts: 743
  • We're gonna need a new obstacle course...
  • Respect: +78
Re: C, C++ and C# tutorials
« Reply #36 on: October 27, 2011, 06:36:29 PM »
0
yo dawg we herd u liek arrays so we put arrays in your array so you can array while you array

Today in my data structures class we talked about arrays of linked lists.  THAT'S torture for ANYBODY.
lim ( Δ :trollface: -> 0 ) (:trollface: + Δ :trollface:)² + :trollface: = :trollface:

Offline Сєşάя

  • *****
  • Posts: 631
  • Gender: Male
  • I used to be annoying
  • Respect: +72
Re: C, C++ and C# tutorials
« Reply #37 on: October 28, 2011, 05:59:10 AM »
0
Quote from: Travelsonic
Today in my data structures class we talked about arrays of linked lists.  THAT'S torture for ANYBODY.

Vectors, arrays, list, FIFO, LIFO, etc ??

Offline Travelsonic

  • *****
  • Posts: 743
  • We're gonna need a new obstacle course...
  • Respect: +78
Re: C, C++ and C# tutorials
« Reply #38 on: October 29, 2011, 11:50:47 AM »
0
Vectors, arrays, list, FIFO, LIFO, etc ??

That is the class in a nutshell... plus linked lists, binary trees, etc... though we aren't using the STL vector class since we're learning about programming our own container classes.  Or rather, we did, now we're on to linked lists.
lim ( Δ :trollface: -> 0 ) (:trollface: + Δ :trollface:)² + :trollface: = :trollface:

Offline Сєşάя

  • *****
  • Posts: 631
  • Gender: Male
  • I used to be annoying
  • Respect: +72
Re: C, C++ and C# tutorials
« Reply #39 on: October 29, 2011, 01:40:20 PM »
0
I read a lot the book of Language C. I'll start with Vectors now

Offline Сєşάя

  • *****
  • Posts: 631
  • Gender: Male
  • I used to be annoying
  • Respect: +72
Re: C, C++ and C# tutorials
« Reply #40 on: January 20, 2012, 08:39:35 AM »
0
Lol...I didn't finish my book. Now I'm learning pointers. Damn bro, some parts of C is fucking hard like character manipulation.

Offline Travelsonic

  • *****
  • Posts: 743
  • We're gonna need a new obstacle course...
  • Respect: +78
Re: C, C++ and C# tutorials
« Reply #41 on: January 21, 2012, 10:23:35 AM »
0
yo dawg we herd u liek arrays so we put arrays in your array so you can array while you array

Once I made a linked list class for my Data Structures class [got an A in the end even though I only got 1 out of 5 projects in for the class  :D :D did perfectly on all the quizzes and exams though.]  To test it, I made a linked list, where each linked list node would initiate construction of a linked list, so I'd have a 36,000 node linked list each node creating another 36,000 node linked list, with each node in these lists doing it... until memory runs out.  :P
lim ( Δ :trollface: -> 0 ) (:trollface: + Δ :trollface:)² + :trollface: = :trollface:

Offline Сєşάя

  • *****
  • Posts: 631
  • Gender: Male
  • I used to be annoying
  • Respect: +72
Re: C, C++ and C# tutorials
« Reply #42 on: January 22, 2012, 06:23:37 PM »
0
I'll make a litle "OS" when I know all about C. I won't make a real. Just for kind.

I also know how to use pointers (a bit hard).

Code: [Select]
#include <stdio.h>

main()
{
int x = 5, y = x*x, z = x*y;
int *ptx, *pty, *ptz;

/* Colocando os endereços para cada ponteiro */
ptx = &x;
pty = &y;
ptz = &z;

printf("X = %d\nPos X = %ld\n\n", *ptx, ptx);
printf("Y = %d\nPos Y = %ld\n\n", *pty, pty);
printf("Z = %d\nPos Z = %ld\n\n", *ptz, ptz);
getch();
}
« Last Edit: February 09, 2012, 04:31:33 PM by Сєşάя »