learning C++

General chitchat, advertisements for other services, and other non-Cantr-related topics

Moderators: Public Relations Department, Players Department

Lord_Igor
Posts: 97
Joined: Tue Jun 29, 2004 4:08 pm

Postby Lord_Igor » Sat Jul 08, 2006 1:45 pm

Code: Select all

char pass2[8]="password";

All char strings must end with a null character: '\0'. The above gives pass2 eight spaces for characters and "password" is eight letters so it fits, but there is no space left for a null character. The length of a char string must be at least one more than you need. So

Code: Select all

char pass2[9]="password";

should solve your problem.
User avatar
Pie
Posts: 3256
Joined: Sun Jun 19, 2005 3:30 am
Location: the headquarters of P.I.E.

Postby Pie » Sat Jul 08, 2006 3:07 pm

whats the easyist coading to learn? And then, will you teach me that one instead?
Pnumerical Intuitiong Engyn
Paranormal Investigation Exorsism
Porcupine Interspecies Extra_poison
Pick In Enter

... The headquarters of P.I.E.!!!
User avatar
fishfin
Posts: 490
Joined: Mon Mar 20, 2006 12:38 pm
Location: Nanning, China

Postby fishfin » Sat Jul 08, 2006 11:53 pm

Thanks, that works now.

I was just wondering, is it possible to add pictures and buttons and stuff like that in C++ (or is it more trouble than it is worth or imposible)?
The following statement is not true.

The previous statement is not true.
User avatar
fishfin
Posts: 490
Joined: Mon Mar 20, 2006 12:38 pm
Location: Nanning, China

Postby fishfin » Fri Jul 14, 2006 1:35 am

A guy that I know who does web design told me that I shouldn't be learning C++ but that I should be learning java, which should I learn?
The following statement is not true.



The previous statement is not true.
User avatar
Peanut
Posts: 1155
Joined: Mon Oct 18, 2004 3:01 pm

Postby Peanut » Fri Jul 14, 2006 11:28 am

fishfin wrote:A guy that I know who does web design told me that I shouldn't be learning C++ but that I should be learning java, which should I learn?


That depends on what you want to make.

c++ is a bit more difficult then java.
Java can be run as applets on webpages which c++ can't.
Java is an interperted language which makes it really slow usually.

Maybe someone else can post more differences?
User avatar
Chris Johnson
Posts: 2903
Joined: Wed Dec 01, 2004 3:26 pm
Location: East Sussex, United Kingdom
Contact:

Postby Chris Johnson » Fri Jul 14, 2006 3:08 pm

I'd also describe c++ as a procedural language with object-orientated features where-as java is fully object orientated

I'd say it doesn't really matter what you learn - good programmers in one language can pick up other languages reasonably easily - even old hacks like me who started on Fortran 77, when it was still new ;) - entering programs on punch cards and waiting for time on large time sharing mainframes with collosol 16k memories - *sigh* . I still use Fortran today at work - an excellent language for data analysis.

If given the choice to start again , I'd probably plump for c++ over Java , just because I'd feel it gives a better idea of basic input/output and develops lower level skills, but that's purely personal - You'll probably get more immediate satisfaction from Java programming - a lot easier for the novice to produce relatively complex applications from scratch

Return to “Non-Cantr-Related Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest