Tuesday, July 14, 2009

Hello…To C++ Programmers, Would you please tell about the Map of learning C++ LANGUAGE?

"It is easy to learn C++,if you have the good knowledge of C".C++ language is basically an Object Oriented language. Therefore it is also called as Object Oriented Programming(OOP) . The difference between C and OOP is that-----


In C, program is divided into different functions.


In C++,it is divided into no. of objects.


There are some extra features in OOP. They are as follows :


1) Data hiding.


2) Encapsulation.


3) Inheritance.


4) Operator Overloading.


5) Polymorphism.


6) It includes all the featuers of C.

Hello…To C++ Programmers, Would you please tell about the Map of learning C++ LANGUAGE?
First of all read C++ basics like OOPS, then Charcter Sets, Keywords, Variable, Data Types. Then read about Classes and Objects, then try to solve simple questions then move to Conditonal statements(If-Else),then Switch, then Looping and so on

land survey

C++ Programmers i realllllly need ur help!!!?

if you can please do this program for me or guide me as to how to do this it would be MUCH appreciated. This is all i can do: (i can only find the remaining time of the same day, not of a specific date)





#include %26lt;iostream%26gt;


#include %26lt;string%26gt;


#include "ccc_time.cpp"


#include %26lt;cmath%26gt;


using namespace std;


int main ()


{


Time t;


int gethour, getmin, min, hour, remain;


gethour = (t.get_hours()%12)*60;


getmin = t.get_minutes();





cout%26lt;%26lt;"Enter the time that the Exam will begin (hh mm): "; cin%26gt;%26gt;hour%26gt;%26gt;min;





remain = abs((gethour + getmin) - ((hour*60) + min))


hour = remain/60;


min = remain%60;


cout%26lt;%26lt;"You still have "%26lt;%26lt;hour%26lt;%26lt;" hours and "%26lt;%26lt;min%26lt;%26lt; " minutes to prepare for the Exam.\n";


return 0;


}





Write a program that asks for the due date of the Midterm (hour, minutes). Then print the


number of minutes between the current time and the date of the midterm in the form “You still have XX


hours and YY minutes to prepare for the midterm.”

C++ Programmers i realllllly need ur help!!!?
If you are still stuck, may be you can contact a C++ expert at website like http://askexpert.info/


C++ programmers hand example?

help

C++ programmers hand example?
class Hand


{


Hand() {};


~Hand() { cerr %26lt;%26lt; "Ouch!" };





int numFingers() { return simpsons() ? 4 : 5; }





Sound* clap() { return SoundDB()-%26gt;oneHandClapping(); }


};





That's the best I can do with the info provided....
Reply:John's answer was brilliant.


C programmers! help pls?

what is the code to:





1. display NEATLY a 10 x 10 multiplication table


2. display a 12-month calendar by asking user some info about the starting day





using nested "for" loops only..thanks a lot!

C programmers! help pls?
#include %26lt;stdio.h%26gt;








int main() {


// Part1.


for (int i = 1; i %26lt;= 10; i++) {


for (int j = 1; j %26lt;= 10; j++) {


printf("%3d ", i*j);


}


printf("\n");


}





// Part2.


int daysInMonth[] = {31,28,31,30,31,30,31,31,30,31,30,31};


char *monthName[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};


int w;


printf("what day is Jan 1 (0-Mon, 6-Sun):");


scanf("%d", %26amp;w);


for (int i = 0; i %26lt; 12; i++) {


printf("%12s\n", monthName[i]); // Month name in the middle.


for (int j = 0; j %26lt; (w%7); j++) printf(" "); // Empty spaces for the first week of the month.


for (int j = 0; j %26lt; daysInMonth[i]; j++) {


printf(" %2d", 1+j);


w = (w+1)%7;


if (w == 0) printf("\n"); // w is the weekday.


}


printf("\n");


}


return 0;


}
Reply:10 x 10:





for (x=1;x%26lt;=10;x++)


{


for(y=1;y%26lt;=10;y++)


{


cout%26lt;%26lt;x*y%26lt;%26lt;"\t";


}


cout%26lt;%26lt;"\n";


}


C Programmers, help me please...?

how can I count a certain letter or digit in a word?





let's say





MISSISSIPPI





1=M


4=I


4=S


2=P





it would me more appreciated if your answer would be string, array, etc.

C Programmers, help me please...?
char *mystring = "MISSISSIPPI";


int length = strlen(mystring);





int countletters(char str[])


{


int count = 0, k = 0;


while (str[k] != '\0')


{


if (str[k] == 'YOUR LETTER')


count++;


k++;


}


return count;


}





hope this will solve your issues





Cheers:)
Reply:hello friends! i am prabhakar gunturi. iam sure that below solution will work. after that you please send this type of questions to my mail. waiting for your mail.








#include%26lt;stdio.h%26gt;


#include%26lt;conio.h%26gt;


#include%26lt;string.h%26gt;


static int flag[100];


void main()


{


static int count,l,i,j;


char sentence[100];


clrscr();


printf("enter any string");


gets(sentence);


l=strlen(sentence);


for(i=0;i%26lt;l;i++)


{


count=1;


for(j=0;j%26lt;l;j++)


{


if(flag[i]!=1)


{


if(toupper(sentence[i])==toupper(sentenc...


{


count++;


flag[j]=1;


}


}


}


if(flag[i]!=1)


printf("The character %c presents %d times in the given string",sentence[i],count);


}
Reply:If you're looking for a specific character, do:





int CountCharacters(char *str, char find)


{


int count;





for (count=0; *str; str++ )


{


if ( *str == find )


count += 1;


}





return count;


}





Building on that (although definitely not especially efficient since it requires scanning the string for each letter), if you wanted output:





void CountCharacters(char *str)


{


char *find;


char *findPointer;


find = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";





for ( findPointer = find; *findPointer; findPointer++ )


{


int count;





count = CountCharacters(str, *findPointer);


if ( count %26gt; 0 )


{


cout %26gt;%26gt; *findPointer %26gt;%26gt; "=" %26gt;%26gt; count %26gt;%26gt; "\r\n";


}


}


}
Reply:qsort(string,sizeof(char),strlen(string)...


char*ptr = string1;


char chars[strlen(string)] = {0,0};


int count[strlen(string)] = {1,1....};


i=0;


while(*ptr)


{


if(*prt == *(ptr+1))


{chars[i] = *ptr;count[i]++;}


else


{chars[i] = *ptr;i++;}


}

survey software

C programmers, have you seen this before?

I was comparing two floating point numbers to determine when to exit a loop. One floating point was set to 2 (float1). The other started at 1 (float2) and was incremented by 0.2. The loop was supposed to exit when the second floating point got to 2.2 (as in loop while(float2 %26lt;= float1), but it would always exit at 1.8. The only way I could fix it was to do a (fabs(float1 - float2) %26lt; 0.01), along with an or statement of float1 %26lt; float2.


I watched the numbers in the debugger, and it wasn't as if it said 2.00001 when it incremented to 2. Basically, it looked as if it was saying 2 is not equal to 2. I thought I was going insane!!! How could 2 not be equal to 2??? But I guess with floating points, there some issue with precision?

C programmers, have you seen this before?
Yes. This happens. Its a problem when you're dealing with floating point numbers. Like 1/3, which cannot be represented by a finite set of numbers (3.333....) floating point numbers have some variance.
Reply:Use abs(f1-f2) %26lt; epsilon(very small number) to compare them


37m india,recently started learning c++ and java,what else should I do to get good job as software programmer?

i am a businessman,and want to switch to software programming as profession,i don`t have any computer background.

37m india,recently started learning c++ and java,what else should I do to get good job as software programmer?
SAP ABAP programming
Reply:in programing languages use for only coding. you want to know entire life subjects ie accounancy,managments.analising designing and everythig
Reply:Dear PS:





1.All you have to do is practise programming using Open source projects, so that you can gain experience to go any projects using the language C++ or Java





2. Learning Java alone will not fetch you any job you dream or desire in this world anymore, add spices like J2EE.





3.Begin yourself in any software concern as a fresher or programme trainee.





$. Rest you'll get to know how you can get ur dream job.
Reply:Do the following


1.Learn the programming from a reputed institute like NIIT etc


2.Make a one page CV


3.Register yourself with naukri.com,timesjobs.com, monsterindia.com and many more


4.Send your Cv to Infosis,Wipro,Tcs,Cognigent etc


5.Your desire will be fulfilled
Reply:Learn programming %26gt; write (good) programs %26gt; sell programs.
Reply:You're already learning the right things as far as which languages to learn. C++ especially is very valuable to professional programmers.





What you need to do next is to get properly certified by whatever authority certifies programmers in your area. After that, its simply a matter of finding someone to hire you.





Hint: Practice developing software by working on some Open Source projects. These are programs in which their creator has decided to make it free to anyone, and in which any programmer in the world is allowed to modify it and make it better. By participating in an Open Source project, you will gain experience working on real-world software, and be in direct communications with highly-experienced programmers who can help teach you.





Good luck, hope everything works out!


I m a .NET programmer and i want 2 change a default error mesaage. how can I do it in C#?

You mean for ASP.NET I presume. You can either define the URL of the custom error at the page level using the Page directive's ErrorPage attribute, and/or you can define it at the web application level in Web.Config, using the defaultRedirect attribute of the customErrors element.


Seeking tips for becoming a good programmer. i'm just a beginner.How shall i start. i know basics of c++,Tips!

plz help me . i m also inspired by the companies like google , microsoft,yahoo! etc. But i want to make my dream come true . Help me with giving me some suggestions. How to start with .How to go for..Some minute things to be kept in mind.And most importantly WHAT CHARACTERISTICS AND PERSONALTIY IS REQUIRED. IM NOT AS SUCH ONTELLIGENT PERSON....

Seeking tips for becoming a good programmer. i'm just a beginner.How shall i start. i know basics of c++,Tips!
Different personalities are required. If you have good attention to details, that is extremely important in "embedded" software design (embedded systems are the small computers that are built into cars, aircraft, photocopiers and such). If you are good in math, then image processing or statistical analysis may be the best field. If you are good with people and planning, then there is a HUGE need for managers that understand software - you may not need to program a lot, but being able to help out in design and estimated is a large asset.





Write lots of software, learn how to debug. The skill of debugging is one of the most important skills that a programmer can learn, yet is often missing in programmers. This point cannot be overstressed.





There is far more to programming than banging away on a keyboard. Take time to design your software on paper. Make sure that the design "feels" right. THEN start to implement it. Starting off on the keyboard is almost a guaranteed recipe for disaster.





Learn how to test your software. Again, this is a skill that is lacking with many programmers. They will try a single test on their program, and call it done. This is not good enough, and once you are working, you don't want your customers to find YOUR bugs - that is not what your employer wants.





You should roughly spend 1/3, 1/3 and 1/3 of your time in design, coding and testing. Programmers often neglect the first and last parts of this.





Do not just chase the latest programming language - learn good programming practices that are portable from language to language.





Hope this helps!
Reply:Try to keep posted on new and exciting technologies.





Remember programming is about programming good (hacking), not about meetings, coaching or any other thing. It is an art, there is no such thing as engineering involved. (Please see Paul Graham on this department).





Then go see best practices and what's horrorful on the great "Code Complete".





Be defensive and pendatic about your code, which shouldn't mean not hearing critisisms.
Reply:I'm not the worlds greatest programmer. More of just a dabbler myself. Just self taught.





1. Comments. Put comments in your work it helps you find what you are looking for easier. Be detailed enough. Gone are the days when space was an issue so comment to your hearts content.





2. Tab Order - Make sure when someone presses tab it goes to the next button or option and not to the other end of the application and back again. (Mostly for Forms)





3. Join mailing lists based on the language you are writing in. This will help give you an group or team approach to any problems you have.





4. There's no such thing as a stupid question, so don't be afraid to ask someone.





These are just basic ideas as to what I think could help you become a better programmer.

survey research

I want to change my profession to programmer. I know a bit html and also hv done basic of C few yrs back.?

Can any 1 pls gv me some information how to reach the level of doing programming in .NET


what languages should i have to know before doing programming in .NET and pls do let me know where i can get tutorials for those languages for free.

I want to change my profession to programmer. I know a bit html and also hv done basic of C few yrs back.?
Well, you'll be better off getting a degree in it, but the URL below has a lot of free resources for exploring different languages and types of programming. Maybe it could help you decide what you need to know and which direction to go from here.
Reply:What is ur background Pls clarify
Reply:To be a good web programmer, I suggest learning C# (C Sharp), ASP.NET and Java (and Java Pages if you can). Alot of development is using the new Visual Studio and that's a good place to start.





Make sure you have a firm foundation in HTML, javascript and CSS before you jump into the programming.
Reply:Ya, Ofcourse you should know everything about programming because there is asp.net, vb and lots of other programming which are all different aspects of programming.. check out on net if u really need to know abt it and your interest in any particular


Where can I find a tutorial on connecting to the cddb using c#?

I am creating a music player (not another one! ahhh hehehe) and i would like to connect it to the cddb for the cd info. I would like any help on a tutorial on connecting to it. I am an intermediate c# programmer, and advanced in other languages.

Where can I find a tutorial on connecting to the cddb using c#?
Unsure about a tutorial, but here is a link to a library that you can use to help out.





http://www.thecodeproject.com/cs/media/f...





I haven't taken a look at the library, but I suppose you could use it to get a better understanding also.


Is there a good scope for C# programmers? IS it possbl 2 get shifted 2 top ITcompanies after gaining experienc

am a mechanical engg graduate... am being offered to join a small company which uses c#... shall i join? plz help me...

Is there a good scope for C# programmers? IS it possbl 2 get shifted 2 top ITcompanies after gaining experienc
U SHOULD JOIN


U CAN TRY IN FOREIGN COUNTRIES
Reply:c# is a good programming language n has scope bt i think u should go 4 p-graduation first.. after that u will hav more of opportunities..


Is experience more important, when it comes to C++ and coding?

My husband has been a C++ programmer, he also knows linux, SQL, Java, running a pc virtual machine, pretty much everything there is to know about computers, this guy knows it. hes self taught, and is thinking about going to get his A.A, problem is, is spending 40 grand on a peice of paper worth it? is that what employers look for instead of his 5 years of experience and 13 years of coding? please tell me what you think.

Is experience more important, when it comes to C++ and coding?
His expirence seems flawless, and any employer will be looking for that. Allot of us out there have tons of knowlege about computers, but can't get jobs or careers, or even afford to go to college. His knowlege is very useful and he has several areas of expertiece. If he wants more, which most programmers, and coders do, then he should goto school and get it over with. He just might run into that certain employer that wants to see that $40,000.00 piece of paper. As long as he balances the thin line of Experience with education you can't go wrong.
Reply:I failed out of college and manage to keep getting jobs in the programming industry. If I can get into the interview, it's all downhill from there cause I know my stuff. Most places won't look at me though without it. It's there loss, although I will be getting my degree soon so I can increase my earning power and avoid being rejected by someone's bias against my lack of a degree.





The piece of paper really is worthless, most colleges don't even teach you enough to get out in the field programming, just the basics.
Reply:The "piece of paper" shows commitment, persistence and trainability. All good traits for a prospective employee. It shows an employer that someone was committed to a task and followed through.
Reply:Getting an associates degree in CS shouldn't cost that much. I got a 4 year degree (in Oklahoma) and my TOTAL tuition cost was $16,000.





Experience is gold, but a degree can get you in the door so that people will let you show off that experience.





Could he do online courses or get mondo-certifications: A+, C++, etc? A bunch of accrediations might also open doors.
Reply:As an alternative to a degree, he could instead take standardized tests offered by IEEE and similar professional organizations to get certified.





If he has only his experience, most software development forms won't be interested unless he can demonstrate his skills first.
Reply:Experience in the IT/computer programming field is very important. Almost every employer is looking for at the very least 1yr experience but usually they want 5+ years. Some companies will hire somone that has the equivilent amount of experince to a 4 year degree. It really depends on the employer.





Before he goes to get a degree, get on monster.com, carreerbuilder.com and look for programming jobs, apply to a few even if they are asking for a BS in computer science. You may also want to contact a potential employeer and ask if they except years of experience in leu of a degree.





Good luck!
Reply:Experience is important and it shows the difference between senior developers and junior developers. However, nowadays certification is the most important thing for the employer. Certification is like a proof of skill and expertise.

survey for money

How to add colour and sound effects for c++ win32 console program?

I'm a beginner to c++ programmer and am doind a samaal assignment. I need to add effects to the program e.g. colour font and different coloured backgrounds. Any help or advice given would be very appreciated.

How to add colour and sound effects for c++ win32 console program?
Example:





≡ File Edit Search Run Compile Debug Project Options Window Help


╔═[■]════════════════════════════════ Help ══════════════════════════════3═[↕]═╗


║ /* loop through the available colors */ ▲


║ for (color=1; color%26lt;=maxcolor; color++) ▒


║ { ▒


║ /* clear the screen */ ▒


║ cleardevice(); ▒


║ ▒


║ /* select a new background color */ ▒


║ setcolor(color); ▒


║ ▒


║ /* output a messsage */ ▒


║ sprintf(msg, "Color: %d", color); ▒


║ outtextxy(x, y, msg); ▒


║ getch(); ▒


║ } ■


║ ▒


║ /* clean up */ ▒


║ closegraph(); ▒


║ return 0; ▒


║ } ▒


║ ▒


║ ▼


How do I pass parameters in C?

I'm a beginning C programmer, trying to write a simple little program. The goal is to find the cube of a number (i.e. 2 * 2 * 2=8), by using a self-made function and then passing the argument from the main function to the self-made function then having that number go back to the main function and print the result. Here's what I have:





#include %26lt;stdio.h%26gt;


int test(int first);


int main(void)


{


int number, cube;


printf("Please enter a number: ");


number = scanf("%d", %26amp;number);


cube = test(number);


printf("The cube is %d\n", cube);


return 0;


}





int test(int first)


{


int a, b;


b = first;


a = b * b * b;


return a;


}





I can't figure out what's wrong. Any help would be greatly appreciated!

How do I pass parameters in C?
Here is yours problem:


%26gt;%26gt; number = scanf("%d", %26amp;number);





scanf first scans for the desired formatted string and stores the value in number, but returns the number of extract tokens, 1 in this case, which gets stores also in numbers. After that line, numbers will always be one.





correcct it to:


scanf("%d", %26amp;number);





and it should work also.





Also, you can simply implement test as


int first (int n) {


return n * n * n;


}
Reply:in your program,error part is number=scanf("%d",%26amp;number);


if you use this statement, the output is 1.
Reply:when you compile what does it do, does it give you a correct number or does it output wrong, im not good with C but i do know C++ and that program is pretty much the same as my C++ i know, my yim is in my profile, if you want to yim me i can help you through it





btw, i wouldnt call the main function as void just leave it blank ()


I want help with a c++ program ...please help?

it is a high level hostel management program,with functions i cant understand.if someone is a c++ programmer,pls help

I want help with a c++ program ...please help?
Very willing to help


Please post one of the functions and see if we can explain it to you.


///
Reply:But Where is the program?????????


Outlook COM Add-In with C#?

I was asked to create an Outlook COM Add-In using C#.NET. Anybody have any advice or sample code (using event handlers to manipulate the ItemSend event). It's supposed to fire every time an email is sent asking the user if they want to save the email. If they say yes, it presents their Outlook folder structure for them to pick from; if they say no, it moves the email to the Deleted Items. I'm so lost as a beginner C# programmer. I've never done add-ins, com objects, or event handling. Please help!!!!

Outlook COM Add-In with C#?
take this link, i think its useful





http://msdn.microsoft.com/library/defaul...





enjoy

survey questions

What is the standard format for beginning C++ code (pre-code text)?

I've found multiple suggestions, and am curious about the "best" or most widely used. I'm a novice C++ programmer, and am wondering what the most common basic beginning of a C++ source is.

What is the standard format for beginning C++ code (pre-code text)?
For most of the applications that you will be writing in an introduction course, your source will be laid out as follows:





// helloworld.cpp


// 27 June 2007


// Print "Hello World!" to the console.





// Include necessary headers


#include %26lt;iostream%26gt;





// Use the standard name space


using namespace std;





// Main entry point


int main() {


cout %26lt;%26lt; "Hello World!\n";


return 0;


}
Reply:/*The following is pretty standard: Dont forget to comment */





# include %26lt;time.h%26gt; //Header files





main ()


{


application code goes here





}
Reply:#include %26lt;headerfile(s)%26gt;





#define %26lt;global constant(s)%26gt;





%26lt;global function(s)%26gt;





int main()


{


%26lt;main program%26gt;


}
Reply:You need to clarify what you mean. Are you referring to the comments often seen at the beginning of a source file? Or do you mean actual code? Sorry, but I can't do mind reading, so you will have to add in additional details or repost your question, spelling out exactly what you mean.





I suggest you take a look at popular C and C++ libraries. SGI's STLPort, some of the more well-known libraries on Sourceforge, and so on, are good starting points. Exploring the Linux kernel code will allow you to see how they structure their source files as well.





And for the record, there is no standard format.


How can one suppress/change order static routine call in C++/C ?

This is for C/c++ programmer. I'd like to know how can we suppress/change order of static routine which are executing from code automatically at startup. You don't need to bother about whats routine are for here, just imagin they are called whenever ur application started.

How can one suppress/change order static routine call in C++/C ?
When you have an OO language, my suggestion will always be to use those OO features.


That said, for C++ I would model objects and use their constructors to get a good start in which I can determine the order of construction by calling as needed. Please see the fist link below on how to manage static construction.


So don't think about "functions" but "state/objects" and their "initialization".


Anyone know how to C# program?

is anyone here a good C# programmer? Im making a game and need a little advice. If so add my msn. ickleistheone@hotmail.com

Anyone know how to C# program?
C# is only for # people ;)


How did you learn c++ ?

please only answer this if you are a c++ programmer.





how long did it take you?





are you using it now?

How did you learn c++ ?
yes... I am using C++ now... I am making a games engine at the moment with it.





It took me about 2 weeks to fully understand C++. I didnt just learn the 'Console Application' side, I also learned the proper Win32 and MFC stuff also.





Note:: There are not 'many' places at University that cover win32, so learning that will give you a better understanding to C++!!





If you are new to programming, you may do better to start off with something like Visual Basic (VB). Learn how to use the objects and place code in them.





If you are familiar with some programming, have you tried Java?





Once you understand languages like VB and know how to utilise it effeciently, then give a shot with C++.





When you do learn C++, learn the basic (the console application) and practice using the input and output streams like 'cin' and 'cout'... or the C style of 'printf' and 'scanf, etc'. Learn the extras that VB doesnt do like pointers for example.





Note:: There are MANY decent books on C++ that covers the console application.








For learning the Win32 stuff... I suggest you be very patient towards it, and finding a good book on win32 may be hard to find (I havent found ANY).





I suggest thorough examination into the internet for Win32 tutorials.





I hope this makes things easier for you...





All the best!!!
Reply:Well, it has taken me about 2 1/2 months to get to where I am now, that is, about high intermediate. The best way to learn, other than books and courses, is to .. program. You learn to fix your mistakes and you get a real sense of satisfaction when you complete it! Get some books out the libary or enroll in a course and just learn it, be patient with yourself. Then, when you have an okay grasp of the basics, come up with a list of programs you would like to make and make them.





No, I am not using it now, but I used it about 10 minutes ago to finish building a 2d game I have been working on.





All the best..





Wolf
Reply:It took me almost about 2 months when I had a fairly good chemistry with this language. And I used to program, 8 hours a day.


Yes, C++ is required in the daily bunch of assignments to which I'm upto.





Regards


(Siddharth Razdan)
Reply:practice and hardworking.
Reply:the best way you can get to be good at coding in any language is practice........If you are fairly new to it you may find reading some examples to see how it works





Some online tutorials:





http://www.cprogramming.com/tutorial.htm...





http://www.cs.wustl.edu/~schmidt/C++/





http://www.cplusplus.com/doc/language/tu...








Good luck!!!!!

surveys

What is the best way to learn C++?

I'm a well-versed C programmer and have recently started reading the C++ programming langauge (3rd edition) by Stroustrup (creator of C++), but was wondering if any one had any suggestions for me.

What is the best way to learn C++?
You are absolutely already on the right track. TCPL by Stroustrup is the best book out the for learning C++. I came from a similar background. I programmed in C for many years before moving up to C++. The transition from procedure oriented coding to object oriented coding can be a little difficult, but the more you immerse yourself in it, the easier it will get and the more power that you realize from it. There have been times where I've written code in C++ and been almost in disbelief by how quickly and effectively I was able to do it, whereas in C, it would've taken 10 times as long and would have 10 times the bugs.





You're on the right track. Just keep on truckin'.
Reply:Maybe try looking into a college class or tech school just teaching that class you need. Good Luck
Reply:That's an excellent book which covers pretty much everything C++ has to offer. Try to do all the exercises after each chapter and take into consideration the suggestion Stroustrup is pointing out... It can help you a lot.


Another thing is don't focus on just one book and practice as much as you can.
Reply:I would say that book is your best bet. You already know how to program, and learning C++ isn't that huge of a jump from C at least with your preexisting knowledge.


Using Windows.h in C++?

hi, I'm a new c++ programmer who's trying to learn more about windows programming. I'm currently working with Visual C++ 5.0 Express and I've downloaded then installed the Platform SDK package. Unfortunately, I'm still having trouble including the windows.h package. I've been told that all I need to do is include the correct libraries..I just have no idea how to do that yet %26gt;%26lt;. Any help would be greatly appreciated. Thanks in advance.

Using Windows.h in C++?
The compiler doesn't know where to find windows.h. You can either put the whole path in front of the file name, or you can teach VC++ where to look. Eventually you'll need to link to the lib files too, so may as well configure VC++ to know where everything is...





I don't have 5.0 Express, so I can't tell you exactly what menus to look for. In my version of VC++, it's under Tools\Options. Tab over to directories, and add the include and lib directories for your SDK, and also the directories for your VC++ installation.





Here's an example, but you'll need to find the appropriate paths on your machine (hint. Just search for Windows.h, then copy the path)





Include files:


C:\Program Files\Microsoft SDK\Include


C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE


(plus I have lots more)





Lib files:


C:\Program Files\Microsoft SDK\Lib


C:\Program Files\Microsoft Visual Studio\VC98\LIB


(etc.)
Reply:#include %26lt;windows%26gt;





I don't use VC++ so I'm not sure what you're seeing...but in Borland and Metrowerks it really is as simple as the above.
Reply:use #include %26lt;windows.h%26gt;





windows is in include folder path .. not in the project..


Which are the good sites for learning programming specially C# and Visual C# ?

I am learning C#. both for windows and web programming


Any good sites that teaches completely step by step with good practical example that following industry standards. So I can join and work in the industry as fast as possible as C# programmer.


Thanks

Which are the good sites for learning programming specially C# and Visual C# ?
HI,





There is another good one called www.it-guru.co.uk, lots of things there as well.





Kindest regards
Reply:I learnt programming by using w3schools (http://www.w3schools.com) it is brilliant you can learn all programming languages at your own pace completely free. I passed with distinction in 3 of my computer courses thanks to this website.


Plzzzzzzz .. i want a programmer help me to program the game called (snake) in c++ ??

There's a million places you can download this game. Just use these as examples, and recode the thing using the previous code as a template.

survey monkey

Suggest a best book for C Programming or online material?

I got bored while reading K %26amp; R book.Suggest me a best book so that i can become a best C Programmer.





I don't have any experience in C





Please help me out

Suggest a best book for C Programming or online material?
http://www.cprogramming.com/tutorial.htm...
Reply:C: A Reference Manual (5th Edition) by Samuel P. Harbison and Guy L. Steele is pretty much on the same order as K%26amp;R's white book with the big blue C, but it goes into a lot more detail. Neither of these books is fun to read; they're references, rather than tutorials, but eventually, you need to know all the rules in order to program well.





P J Plauger wrote a book on the Standard C Library. It not only familiarizes you with the functions you need not reinvent, but it shows you the code. You can learn a LOT about writing code by reading code. Reading good code (like P J's) will teach you some things. Reading bad code (as long as you know it's bad code) will teach you far more.





The Waite Group's "C Primer Plus" by Stephen Prata and Mitchell Waite is an excellent tutorial. The current editions list only Prata, not Waite as author, but I assume it continues the tradition. The book contains enough humor to make the learning process easier.





Programming on Purpose: Essays on Software Design by P. J. Plauger isn't about C so much as it is about general programming, but it's something every good programmer needs to learn. There's actually a series here. The first book is far more important than the other two combined.





The Elements of Programming Style by Brian W. Kernighan and P. J. Plauger is another book every good programmer needs to read. This one is more C-centric than the Programming on Purpose books.
Reply:K %26amp; R is the best book on C. Read that book from cover to cover and do all the questions you will know C well after that.
Reply:The books for C Programming language is


1) LET'S C


2) C programming by BALA GURU SWAMY...
Reply:www.cplusplus.com its c++ but c++ is just a bit more advanced than c, why not try c for dummies? theyre always brilliant books


Where can i find a C# Programmers chat room?

I want to chat in c#. Anybody knows any sites? Please!

Where can i find a C# Programmers chat room?
http://www.haneng.com/asp-forum/c-Chat-r...





http://www.aspin.com/home/community/chat...


How do I make a Messagebox show in Visaul C++ 2005?

I'm a Visual Basic/C# programmer and am now trying to transition over to C++a bit. I can really use help tho, see I want to learn how to make a simple message box show in C++. How can I transfer somthing like msgbox("yo") to C++?





Also maybe even changing to another form (vbcode: form2.show)





Any help appreciated





Thanks

How do I make a Messagebox show in Visaul C++ 2005?
if its CLR u are making;





use this





MessageBox::Show("Hello!");
Reply:MessageBox(


hWnd,// handle of owner window


"Apple Computers Suck!",


"Alert!",


MB_OK


) ;
Reply:MessageBox(NULL,"yo","Message Form Caption",MB_OK);


What to learn after learning fundamentals of C++?

I've decided to learn C++ as a hobby, and maybe a job will come out of it down the road. I'm trying to build myself a little road map of what to learn. After you learn the fundamentals of C++, what do you learn next? I've checked out some Windows Programming books, but most seem to be geared towards the C programmer?





I'd like to learn how to build small applications, and games. Can someone please suggest some books?

What to learn after learning fundamentals of C++?
First learn Datastructures. Classes are very important to proper C++ development, so learn it, and use it. There's something satisfying about being able to declare and object you've made and give it near English instructions.





I'd learn OpenGL and/or DirectX for game programming, there's alot of higher level math in them (many texts bog you down with proofs, which you may or may not want/need).





Then if you're going toward web, there's


HTML, JAVASCRIPT, PHP, SQL, JAVA, ASP, JSP





probably in that order.
Reply:select and learn your tools in c++...





learn opengl in c++ or directx in c++...


learn to develop using third party frameworks and integrating with other languages and formats..





you can work with c++...good show...now use it to branch out..


if you wanna get into hardcore gaming and stuff...study the long lost art of assembly programming..





windows and mac api's are geared towards c instead of c++ for backwards compatibility and standards...but you should have no problem working with them in c++...
Reply:After the basics, you would need to shift into Windows Programing. This is a lot more complex, but well be the meat of what you well use.

online survey

Emulate microphone input (C#)?

I would like to know if there is any way to emulate microphone input. for example if im on skype or something and i want to show a song to the person im talking to. instead of putting the microphone up to the speaker, is there any way to emulate the microphone input so that it sounds perfect?





also, i am interested in how such software would work.i am a C# and C++ programmer and would like to know how i would go about making a program that does this.





thanks for your help

Emulate microphone input (C#)?
no you have to link the mic


C++ - what's the default method of opening a file passed to main via *argv[]?

I'm a self-taught C++ programmer, and I stumbled across the second method of main(), being main(int argc, char *argv[]) of course.





The first thing I did was create a small sample program that simply displayed the value of argc and all the values of argv[] that were passed to it. After experimenting with it a bit, I noticed that argv[0] is always the command line text used to execute my program, and the other argv values contain everything else that was passed to it. My question is, where can I go to learn more about the standard methods of passing programs arguments?





I was interested about learning the following in particular:





-How are parameters starting with tags such as -o, -f, -a, and so on usually handled?





-I noticed that, if a file opens the program via a file extension associan, argv[1] contains the location of the file calling my program. How am I to know when argv[1] is a file location, and not a usual parameter? Should I check for C:\? I've just been checking for "*:\"

C++ - what's the default method of opening a file passed to main via *argv[]?
The truth of the matter is that C++ doesn't do any handling of files/flags/parameters whatsoever. When you pass extra command lines to a program, the strings themselves are passed as char arrays (char []) sequentially into the elements of argv[] (an array of char arrays). When a space occurs in the command line, that serves as a delimiter, so every time a space show up, a new char array is added to argv[] and argc is incremented. The one exception to this delimiter rule is when you use quotes on the command line. A quoted string is passed in its entirety as a single argv element. Thus, if you ran MyProgram.exe -o -f -a C:\Program Files\MyProgram\Program Data\test.dat then argv will be an array of size argc containing the following char arrays:


argv[0] = MyProgram.exe


argv[1] = -o


argv[2] = -f


argv[3] = -a


argv[4] = C:\Program


argv[5] = Files\MyProgram\Program


argv[6] = Data\test.dat


making argc=7. Thus if you wanted to retrieve the original command line, you could do something like the following:


string argument="";


for(int i=0; i%26lt;argc; i++)


{


argument+=argv[i];


if(i!=argc-1) //add spaces to all but the last element


argument+=" ";


}


which will result in argument containing exactly what was placed on the command line. Notice how the path argument was split into multiple char arrays because of the spaces in the path. This is sometimes a big problem if not handled correctly. You will have to decide how your program will need to parse argv[] depending on expected input and how you plan on handling it. Notice also that argc contains one more than the number of command line arguments (because argv[0] is the program name itself, useful sometimes when you want to title a window or change your output like in a help printout of how to use the program depending on the name of the exe itself, meaning if the user renames the file it will still show the proper command line to use!). You have to be careful to check argc before you try parsing the command line though or you'll get out of bounds errors, leading to your program crashing or using invalid data at best, taking down other programs or even the OS at worst, though you'll need an older OS to make those happen really). Once you have properly parsed your command line and have gotten the string "C:\\Program Files\\MyProgram\\Program Data\\test.dat" finally, you can use your favorite method for opening files from path, ranging from C's FILE pointer to more complex methods in C++, MFC, Win32, ATL, or your own self-written file class. Have fun!


I'm about to give up with c++ ....?

I've been trying really hard to be acquainted with C++ writing, but it just seems to difficult. I can't get into it. I just can't do it. I really want to be a programmer for video game development when I grow up, and I've been trying so hard to get into it but I just can't. Where should I start? What should I do?........ How did all of you C++ programmers start?

I'm about to give up with c++ ....?
http://www.amazon.com/C%2B%2B-Dummies-St...
Reply:Try


C++ for Dummies


of


The Complete Idiot's guide to C++





Both books, while somewhat insulting, will explain it in lay terms........





Good luck.......Some things are not learned overnight, so have patience with yourself.
Reply:hey cheer up. You can be held down by this. You got a long way forward.


For C++ Programmers?

Can anyone tell me how to write a C++ program that appends data to the end of the file “abc.txt” ?





example program code is needed..


Thanks in advanced..

For C++ Programmers?
try opening the file in append mode . that is sa follows





FILE *fp;


fp = fopen("abc.txt","a");


// now write in the file whatever you wanted ,


// it will be appended ( a simple way)





//for writin a character


int putc(int ch , FILE *fp);


// now the charactrr pointed by "ch" will be appended





// or you can get the character from console as





do


{


ch=getchar();


putc(ch,fp);


}while(ch!= "$");








.........................


the easiest way is above :)
Reply:FILE* abcFile = fopen("abc.txt", "a");


fprintf( abcFile, "This is appended text\n");


fclose(abcFile);
Reply:#include %26lt;fstream%26gt;





...





ofstream outFile("abc.txt", ios::app);


outFile %26lt;%26lt; "I just appended this line" %26lt;%26lt; endl;


outFile.close();

salary survey

Which OS is which? (VC++, C++) programmers...?

Do you know any command (method or any sort of commands) in Visual C++ that is used to determine which operating system is running?


For an example, if your machine is running in XP Operating System, this code will give a result that the OS used by the machine is XP..





Please help... and Thanks in advance





RedScar

Which OS is which? (VC++, C++) programmers...?
VC++ v6.0 Help


-------------------------


_osver, _winmajor, _winminor, _winver


These variables store build and version numbers of the 32-bit Windows operating systems. Declarations for these variables in STDLIB.H are as follows:





extern unsigned int _osver;


extern unsigned int _winmajor;


extern unsigned int _winminor;


extern unsigned int _winver;





These variables are useful in programs that run in different versions of Windows NT or Windows 95.





Variable Description


_osver //Current build number


_winmajor //Major version number


_winminor //Minor version number


_winver //Holds value of _winmajor in high byte and value of _winminor //in low byte


----------------





So, i mite use liek so:


#include %26lt;STDLIB.H%26gt;


...


...


printf("Windpws Ver %d.%d\n", _winmajor,_winminor );





--------more from help ------[index on "OS"]-----


OSVERSIONINFO


The OSVERSIONINFO data structure contains operating system version information. The information includes major and minor version numbers, a build number, a platform identifier, and descriptive text about the operating system. This structure is used with the GetVersionEx function.





typedef struct _OSVERSIONINFO{


DWORD dwOSVersionInfoSize;


DWORD dwMajorVersion;


DWORD dwMinorVersion;


DWORD dwBuildNumber;


DWORD dwPlatformId;


TCHAR szCSDVersion[ 128 ];


} OSVERSIONINFO;





Members


dwOSVersionInfoSize


Specifies the size, in bytes, of this data structure. Set this member to sizeof(OSVERSIONINFO) before calling the GetVersionEx function.





dwMajorVersion


Identifies the major version number of the operating system. For example, for Windows NT version 3.51, the major version number is 3; and for Windows NT version 4.0, the major version number is 4.





dwMinorVersion


Identifies the minor version number of the operating system. For example, for Windows NT version 3.51, the minor version number is 51; and for Windows NT version 4.0, the minor version number is 0.





dwBuildNumber


Windows NT: Identifies the build number of the operating system.


Windows 95: Identifies the build number of the operating system in the low-order word. The high-order word contains the major and minor version numbers.





dwPlatformId


Identifies the operating system platform. This member can be one of the following values: Value Platform


VER_PLATFORM_WIN32s Win32s on Windows 3.1.


VER_PLATFORM_WIN32_WINDOWS Win32 on Windows 95 or Windows 98.


For Windows 95, dwMinorVersion is zero.





For Windows 98, dwMinorVersion is greater than zero.





VER_PLATFORM_WIN32_NT Win32 on Windows NT.











szCSDVersion


Windows NT: Contains a null-terminated string, such as "Service Pack 3", that indicates the latest Service Pack installed on the system. If no Service Pack has been installed, the string is empty.


Windows 95: Contains a null-terminated string that provides arbitrary additional information about the operating system.





QuickInfo


Windows NT: Requires version 3.5 or later.


Windows: Requires Windows 95 or later.


Windows CE: Requires version 1.0 or later.


Header: Declared in winbase.h.


Unicode: Defined as Unicode and ANSI structures.











-----------------








....for more info, use online Help in the programmer workbench.....really excellent src.
Reply:You get some expert help from


http://tutorialofc.blogspot.com/


Hi, I'm an intermediate programmer, can you give me some graphical code for c++??

please, I need some code that will work with visual studios 2008 in that it doesn't have:


#include%26lt;iostream.h%26gt;,#include%26lt;fstream....


and if that program uses graphic.h, please tell me where to download graphic.h.


I want some easy sorce code,


Thank You very much

Hi, I'm an intermediate programmer, can you give me some graphical code for c++??
i have some codes which i posted right in this link... http://pscode.com/vb/scripts/ShowCode.as... ..or visit my blog and just leave a comment at http://ronaldborla.blogsome.com/ or http://ronaldborla.wordpress.com/


Also http://ronaldborla.blogsome.com/2008/02/... for my biggest announcement in my blog... (^^,) Thanks!


Microsoft Visual C++ vs Borland Turbo C++ ????

I use Borland Delphi and now i want to move to C++, but i'm confuse which tools i should use, Borland Turbo C++ (which i'm familiar with their vcl) or Microsoft Visual C++ .


which one is most used by visual c++ programmer ?


any suggestion ?

Microsoft Visual C++ vs Borland Turbo C++ ????
That question is like asking what is the best browser Internet Explorer or FireFox, or like asking what the best search engine is Yahoo, Google, MSN, etc. It is all a matter of preference, or what you are used to using.





Some people use Borland, some people use Microsoft. I, myself use Microsoft Visual C++. The reason is because I started off using Borland, but everybody at the company was using Microsoft, so I switched. I went to an interview recently and they were using both tools, the company had merged 2 different groups into 1. So, you might want to check out which industry is using which tool, then go from there. I don't know that much about Borland to comment about their program, but Microsoft has a domineering effect in the industry, IMO.
Reply:If you want to work professionally, it's Microsoft.


If you work for fun or just to quickly learn something, use whatever you prefer.


Can a programmer make around million $ a year? if yes what kind? (C, C++)?

Hello Garfield, that's an interesting question. I did dream in the past of becoming a millionaire computer programmer but I have now come to realize that it takes more than just skills in programming (C++, C, or any other kind of programming language) to get the cash flowing. You must first begin by understanding the computer software market. For example, if you're into developing software for mobile-based platforms (mobile phones, PDAs etc), then you may want to do some research on the current market trends concerning these specific products. To sum it up, you're not going to get much from just focusing on computer languages, because there are just too many of them out there. Reaping a million dollars from programming certainly isn't impossible, but you've got to have an entrepreneur's mindset to complement your skills in programming. It's not about the language, it's about the market which you wish to tap into. For more information, you may wish to visit http://www.entrepreneur.com for some idea. Good luck and all the best in your quest to become a millionaire programmer! ;-)

Can a programmer make around million $ a year? if yes what kind? (C, C++)?
no, because then I'd be a programmer instead of a doctor

surveys

Any good c++ programmers?

Anyone who would like to help me with c++ project offline.I WOULD APPRECIATE your help if u are the one can e-mail me

Any good c++ programmers?
I look forward to help you, but unfortunately I just now began to start learning C++. But Im sealed concretely for programming in C. Do u need any like solving tricks and teasers, I ll do for u, but i need reply
Reply:iwould love to help you but am starting to just get the grip of it. do u want any c++ program for a tic tac toe game i have that haha thats the only thing i did so far
Reply:I can go as far a classid and anything in a book b4 that





(my c++ teacher read a book and then gave us homework.)





if you want my email let me know


Im Calling All C++ Programmers. I need help with a program. IM Me when You Read my problem?

Okay Im a first time programmer and I really need help with my second project in programming. It's spring break and I have to work all break on this project just because I don't know what Im doing. I have started on the project but it's going nowhere fast. Im looking for some open minded helpful individuals that don't mind helping me to write my program.Anyone that fits this profile please IM or email me at patrickjohnathan@yahoo.com, or at patrickjohnathan@hotmail.com.





Thanks In Advance Guys!!!

Im Calling All C++ Programmers. I need help with a program. IM Me when You Read my problem?
perhaps you could provide some description of the project?





What have you done so far?


C++ really confused?? msdn, sdl, api ext......?

I am a beginner c++ programmer. Only have been working in console mode but would like to move onto win32 or win64 apllications and eventually games. When i search on the net for C++ tutorials i get terms like sdl, msdn. api and i have know idea what they mean. Also i downloaded a sdl library for dev-c++ and linked it. is the sdl library a standerd or are there other versions. does it work with opengl or directx. If possible i don't want to program using the .net framework. It's a ok for nissness applications but not games because you need mor control over the GUI. I don't know where to start when it comes to win32 programming? any help would be appreciated?

C++ really confused?? msdn, sdl, api ext......?
Well, its good that you want to enter the complex world of graphics programing. Welcome to real business :)





To start you first need to brush your skills with drawing simple graphics and moving them around the screen. You can start with simple things first, say pure C in a DOS based environment and create simple graphics, move them around and create complex shapes with simple objects like rectangles and polygons.





When you get a good grip on that you can start using the win32 model. For that you can get some books first, on Windows graphics API. MSDN (Microsoft Developers Network) is a good resource for getting most information about Microsoft platforms. No need to get into .NET if you feel you dont need it.





The topic of graphics programing is rather complex to be discussed here but there are plenty of books in the market to get you going...





Happy Programing.





PS, do send me a copy of your first game :)
Reply:If you are a newbie then you should first learn assembly, which is relatively simple, and then move on to C++ which is more complicated.
Reply:Win32, OpenGL, SDL, DirectX are APIs. You use an API with


a programming language to create graphics. To create GUI apps, I use Java or VB.net, I don't bother with win32 but that's just me personally. There is a good win32 tutorial here.


http://www.winprog.org/tutorial/


Solve this...any c++ programmers out there..?

a simple c++ program--%26gt;


main()


{ static int a[]={97,98,99,100,


101,102,103,104};


int*ptr=a+1;


print(++ptr,ptr--,ptr,


ptr++,++ptr);


}


print(int *a,int *b,int *c,int *d,int *e)


{


printf("\n%d %d %d %d %d",*a,*b,*c,*d,*e);


}





help me with its o/p....i m not getting it..


its showing 100 100 100 99 99


but i thought 99 99 98 98 99

Solve this...any c++ programmers out there..?
This is due to the fact that the compiler execute printf from right to left internally but prits the output Left to Right. So if you look at the printf this way you will understand the output. i.e





1st execution will be ++ptr


2nd execution will be ptr++ and so on......
Reply:The print( ) statement with all the incremented and decremented ptr arguments can give different results on different C compilers, because there is no rule for the compiler about the order in which the arguments should be evaluated.





b, c, d and e are not declared, so the program should not compile anyway, and they are not initialised, so if it somehow compiles, the results of their print( ) statements could be anything.

survey monkey

Visual C++ Programmers... Please help...?

Is it possible to change workgroup settings to member of domain settings for My Computer using the Visual C++ language?





If it can, do you know any sites I can refer to or do you know any syntaxes that is responsible for changing workgroup to domain?





Workgroup and domain can be found at: My Computer %26gt;%26gt; Properties %26gt;%26gt; Computer Name (2nd tab) %26gt;%26gt; click "Change" button





Please help... =(

Visual C++ Programmers... Please help...?
You do this sort of thing using the WMI interface, this kind of enterprise level scripting is usually done using VBScript.





Use:


std::system("cscript.exe someVBScript.vbs");





See the following link for code-





http://cwashington.netreach.net/depo/vie...
Reply:http://poincare.matf.bg.ac.yu/~filip/nm/...


To all c++ programmers, PLEASE HELP!.?

I've asked this question before, but didnt really get clear answers.


i am embarking on a journey to learn C++.. and i was wondering if i can use C++ to create something like IRCX pro. and also a web chat control. Any ideas on where to start the code, or what i should start working on first?

To all c++ programmers, PLEASE HELP!.?
i know c++ very well, but never heard of IRCX pro....???
Reply:IRCX pro. Tell more about it.
Reply:Well, you will have to learn the Standard C++ language first.


You will have to learn how to use the compilers and so forth to develop with C++


Then you will need to know about the operating system you want to work on. For instance, if it is windows, you would have to learn the WinAPI or similar like OLE, MFC, etc. The operating system should control issues like a graphical user interface (GUI). A GUI is the thing you are using right now, if you use a mouse to interact with it, and it is graphical and not just a command line.


You also need to know about algorithms, so you can design or choose the best one for your program.





You may not need a GUI for the web chat control, but this is the basic procedure you are going to have to go through.





If you know all of this, the way to start would be.


Design the program you want, describe what you need and what the program to do. Review this description, and go into further detail with another description. Repeat until you can think of nothing else.


The things you may need are basic services like, get a file, save text, write text, etc. Have little routines to cover these things. All these things should be dealt with in the description above, with the little things being the finest detail you could get.


Build on top of these services by adding them together to create a bigger module. Repeat until you have made the program similar to how you designed it. If you change anything, go back to the description, as you may need to change more than you think.
Reply:to create a chat program, you should use C++ Compilers in windows like Visual C++.


and you should learn how to use Sockets


but i offer you Borland Delphi


it is very easier and also powerful for programming in Windows


and Delphi 7 has a chat program as a Demo internally that you can learn how to write a chat program
Reply:you will get clear answer if you will ask clear question...


do you really think this information is enough?? i m C++ guy...but i dont know what is this IRCX pro. and you can create web chat application..but not sure about control..are you using Visual C++??





pal, be descriptive..


Is it dangerous to mix the C with the C++ language.?

I'm a beginner C++ programmer, i'v noticed that there are a lot of C tutorials that allow the programmer to use the win32 API without any extra support. What i was thinking, is it possible to use objects and classes and incorprest that into a C but use a C++ complier.

Is it dangerous to mix the C with the C++ language.?
Yes, you can mix the two. C++ is a superset of C *but* there are some subtle differences that can cause a headache now and again.





One big item no one here has mentioned is that because C++ supports function overloading it "mangles" function names. If you are using a unit compiled by a C compiler you must declare the header file with extern "C" scope. In essence this tells the C++ compiler not to mangle the functions names in the C++ manner but to use the C naming convention. Doing this will allow your program to link properly.





Example:





extern "C"


{


#include "some_C_header.h"


}
Reply:You can combine ANSI standard C and C++ since C++ is simply 'enhanced C'. The result is C++ code
Reply:Yes C++ is an extension of C so ANYTHING you see that is done in C WILL work in C++ ... its not dangerous whatsoever to mix the two simply because they are one and the same (assuming you use C++, since it is a superset of C)... You mention win32 APIs and i've used those within C and in C++ without any problems at all. In fact you can even not bother with objects and classes all together (making it simply a C program, for the most part) and still compile it fine as C++. C++ gives you extensions that you have at hand, it's just a matter of whether you want to use them that differentiates C and C++.
Reply:You can download a free version of Microsoft Visual C++ at the URL below. It will recognize the difference between C and C++, based on the extensions of the file names. It has built-in facilities for handling the windows API.





Yes, you can mix C and C++, but remember that most callable routines in C++ are inside of an object. So you will need to tell your C code how to get "inside" the objects, probably by treating them as "structs". Usually it is not necessary to use C if you are using C++, since C++ can do everything that C can.
Reply:Absolutely not, C++ is a superset of C, which means everything contained within in C you can do. There are a few differences. For example, in C++, main must return an int. Also, structures are declared slightly different, but you can still use the C way. Win32 API is written in C, so it should be no surprise that it works. MFC is the Win32 API wrapped in C++ classes. The important thing to realize though, when using C header in C++. Normally you include %26lt;string.h%26gt;. C++ headers leave off the extension. So many people will think %26lt;string%26gt; equates to %26lt;string.h%26gt;. This is not true. All C libraries should begin witth a 'c'. So %26lt;string.h%26gt; equates to %26lt;cstring%26gt; and %26lt;stdlib.h%26gt; to %26lt;cstdlib%26gt;, etc.


C programmers help me please?

want help in a C program


in which i have to display tables of numbers upto the no which user enter





but imust use all of these following


1)pointer


2)function


3)recurtion

C programmers help me please?
ok a function is just a way to divide up the code to do something for you. A pointer points to an address in memory where something is stored, and recursion is a process in which an algorithm is repeated.





Ex:





int NumberArray[100]; //makes an array to store up to 100 integers


int HowLarge; //variable for how many numbers are to be in the array





int *GetNumbers() {


cout%26lt;%26lt;"How many numbers are you going to input?"%26lt;%26lt;endl;


cout%26lt;%26lt;"Choice: ";cin%26gt;%26gt;HowLarge;


for(int i=0 ; i%26lt;HowLarge ; i++) { //the recursion part, it gets user input to add any numbers in the array


cout%26lt;%26lt;"Input Number "%26lt;%26lt;i+1;cin%26gt;%26gt;NumbersArray[i];


}


}


//ok pretty easy, gets numbers and puts them in an array.





void ShowArray(int *Array) { //now we will show the array


for(int i=0 ; i%26lt;sizeof(Array)/4 ; i++) { //cycles through the array


cout%26lt;%26lt;"Number "%26lt;%26lt;i+1%26lt;%26lt;" of the Array is: "%26lt;%26lt;Array[i]%26lt;%26lt;endl;


}


}





that should do it. If you have any questions about the code look at the refrence below.
Reply:instead of asking people to do your work for you, post a code sample of what you have done already. that way you learn what you did right and what you did wrong. Having someone write a program for you is a waste.
Reply:I agree with thunder.... if you show me I can help you, I may be a young girl ( roughly 17) but I got the answers. ^_^ so show me the money!

online survey

C PROGRAMMERS!! Write a program to do the following.....?

Write a program to do the following:


(a) use a loop to print out the numbers from 1 to 50; the end result should look like this:


1 2 3 4 5 6 7 8 9 10


11 12 13 14 15 16 17 18 19 20


21 22 23 24 25 26 27 28 29 30


31 32 33 34 35 36 37 38 39 40


41 42 43 44 45 46 47 48 49 50


(b) in main() you will have a loop that generates the line number for each line. It will pass


this line number to a function; the function will use the line number to determine the


column values to print out. note that the coordinates of any particular value are (row,


column) with (1, 1) in the upper left corner. NOTE: I rewrote this bullet point to make


the requirements more clear.


(c) do this without using arrays, any kind of lookup table, or just hard-coding values, i.e.,


don’t do this


if (row == 1)


printf(" 1 2 3 4 5 6 7 8 9 10");


(d) the numbers should line up

C PROGRAMMERS!! Write a program to do the following.....?
Merry Christmas. For New Years you need to promise yourself you are going to learn this stuff.





#include %26lt;stdio.h%26gt;





void print(int rownum)


{


int start, end;





start = rownum * 10 + 1;


end = start + 10;





for (; start %26lt; end; start++)


{


printf("%02d ", start);


}





printf("\n");


}








int main(int argc, char *argv[])


{


int row;





for (row = 0; row %26lt; 5; row++)


{


print(row);


}





}
Reply:use string formatting (printf), it accepts a format code, and some datas, then output the data in the way described by the format code.





for your particular need, you'll need to iterate on this ten times with for:


for (n = smallest; n %26lt; smallest + 10; n++)


printf("%2s ", n)





after that, print a newline





Note: The code above need to import stdio.h





EDIT:


The code above is simple, first the heart of the code is the string formatting:


printf(formatcode, data1[, data2, ...])





This line would print a string with a format defined in the format code. The format code ("%2s ") is a string, as you can see. This particular format code reads as follow: the data is inserted ("%") with width of 2 ("2") as a string ("s") and there is a space in the end (" ").





(string formatting is quite complex to be explained, so for further information about string formatting, see: http://www.cs.utah.edu/dept/old/texinfo/... )





Then, we iterate over the string formatting function ten times per function call using a for-loop. As we know, C (and most other programming language) doesn't automatically print a newline after a print function, so the next call to printf would print the next number beside the last number. At the end of the loop, we print a newline so the next call to the function would print everything on the next line.
Reply:dno if i can


C++ tutorial?

hey...im a c programmer...an amateur...ive just finished reading and understanding my c programming book..now...im ready to take the next step for programming...im ready to learn c++...now,..





what are the best site where i can learn c++ for c user???








best link gets 10 points!!

C++ tutorial?
I'm a fan of these sites:





http://www.4p8.com/eric.brasseur/cppcen....


http://people.cs.uchicago.edu/~iancooke/...





You may also just want to look up some general sites on object oriented programming, as that's one of the biggest additions in C++.
Reply:http://www.google.co.uk/search?q=free+C%...
Reply:um... try mcafee.com
Reply:http://cplusplus.org/


http://cplusplus.com/


You can also to look for "cpp" in newsgroups.


Sunday, July 12, 2009

C++ programmers please answer this question?

I am writeing a very drifficult mathmatical program and I extremlly


need to make a tree of opraters.


I've made a structure like this:


struct tree_struct{


struct tree_struct *left;


char node;


struct tree_struct *right;


};


I need to make an array of this new type,and use it as a stack.so


I did so:


struct tree_struct *stack[4];


and by using 'new'(or malloc in c) I got memory for this pointer.


my problem is in this assignment :


tree-%26gt;left= stack[1];


why this assignment is not true ?I don't know?!!


please help me.


thanks for spending your time to answer my question.

C++ programmers please answer this question?
You have an allocation problem...


is you stack[1] previously allocated like: stack[1]=new struct tree_struct;?


if so than tree-%26gt;left=stack[1] should be valid (but be carefull to previous allocate the "tree" var...).if tree is NULL the tree-%26gt;left is ilegal...
Reply:I have a few questions to ask before i can answer ur question:


1) How exactly are u allocating the nodes of the tree.. plz show me the intended statement


2) Is the array storing the mem of the new nodes?


3) if u intend to do tree_struct-%26gt;left=stack[1] u atleast need to use a handle to access the member... i really dont understand what u're doing there. Perhaps a completed code segment would help.
Reply:wat is your exact problem ???





i cant get you ...





the stack starts with 0 or 1 ????????????


!!All C/C++ programmers should click here!!?

Which is a better compiler----Dev C++ or Microsoft Visual Express 2008?





Why?





Which one do you use?





Can you please explain me classes?





The most exhaustive answer gets 10 points!


(But dont just copy-paste frm another website coz i will be putting the thing in quotation marks to Google it)

!!All C/C++ programmers should click here!!?
Dev C++ isn't a compiler. It is an IDE. It uses MINGW, which is based off of GCC.


So are we talking compiler or IDE? With that said, Microsoft latest compilers 2005 and 2008 are excellent, and they are ANSI compliant, so that argument about being proprietary is bs. Sure you can down that path, but you are not required. The only quirk I have found between the two was in a student's program, where when compiled in Dev-C++ it caused the OS to throw an exception, and it didn't in Microsoft. My conclusion was based on the code, that Microsoft compiler initialized the variable with 0, and thus prevented the exception; whereas, GCC didn't. You can look at this as either good or bad.





Now as far as IDEs, Visual C++ is slower to load, but beyond that it is far superior to Dev-C++, especially when it comes to debugging. The debugger in Dev-C++ is still problematic. The intellisense in Dev-C++ is also much slower than that with Visual C++.





I personally usually have more than one compiler, and have both of these installed, plus some others, but if you were only going to go with one I would go with Microsoft's. I also find Visual Studio's error messages to be more verbose and precise.





Classes are only part of C++, and not C. They are used to support object-oriented programming. Object-oriented programming is programming in which data and the particular functions that perform work on that data are combined into structures called classes that act as a blueprint to make objects.





Classes are very similiar to structures. In object-oriented programming, you make objects. For example, you can make a class called Car. This car has variables to hold the make, model, and year of the car in the class. It also has methods or functions to perform operations on that class or change the data or state of that class. From this class Car, objects can be created. For the most part a class is a complex data type, just like int, bool, char. An object is an instance of the data type. It is like a variable name that is declared.(eg. int x)
Reply:I use Visual Studio because friend and foe agree that it's by far the best IDE out there. Admittedly, MS does not completely adhere to all standards (it's spelled 'proprietary' btw) but if you as a programmer are knowledgeable you can always force yourself to abide to standards.





And if you want a light footed compiler that adheres to standards, you should go for gcc... :-)
Reply:i use Dev C++ i tend to avoid Microsoft's propriatery stuff...





Microsoft usually adds their own set of garbage into the mix. Dev C++ has a much lighter footprint and is fully-functional.
Reply:I use Dev always have done and always will,


1) Good gui


2) It is not microsoft


I have it on my 2 desktops and my laptop, it is light and works on most OS even the old 95-Me for windows
Reply:When I was trying to learn C (I didn't get very far), I used dev C++





If C doesn't work out for you, try to learn BASIC. Yes, BASIC is old, but it's easy to learn.





http://www.anime.web.tr/download/qbasic4...

salary survey

C++ Programmers, need help. would you?

I wrote this program and i compiled it successfully, this program runs successfully, but when it retrieves data from user the program get closed. whats the prob?


Here is my program and my compiler is Dev-C++





# include %26lt;iostream%26gt;





using namespace std;


int main ()


{


float grade;


printf ("Please enter your grade : ");


scanf("%d",grade);


if (grade %26gt;10){


printf("You have passed the test...");


}


else


{


printf("You havent passed the test...");


}


cin.get();


cin.ignore();


return 0;


}

C++ Programmers, need help. would you?
There are two problems:





1. In the scanf the %d means the input is an integer, but you declared the variable as a float.





2. Also in the scanf, you need to pass a reference to the variable, not the variable itself.





So change it to scanf("%f",%26amp;grade);





And it will work for you. %f means float, and %26amp;variable means take the address of (pass by reference.)





Alternatively, you can declare grade as an int, and keep the %d.








--------------------------------------...


Yes, you're going to have a problem with bogus inputs.





You could check the return value of the scanf call.





if !(scanf("%f", %26amp;grade) {


printf("Rerun the program and try putting in a number this time");


return 1;


}
Reply:I am guessing the enter keystroke you pressed to send your number input to the program zipped you past the cin.get statement and returned (ended). If that´s not the case, you can always through in some trace statements and a few getchar()´s at the end (or step through with a debugger).
Reply:In DEV-C++ you need to add, before your return 0; this linke





"system("PAUSE");"
Reply:cin.get will read a white space because it doesn't expect to read anything from the input. If you run your program from cmd line it won't close automatically after running it (because the cmd session is still active).


The easy way would be to request the user to type in a key to continue, something like...


printf("Press any key to continue...");


scanf("%c",%26amp;key)..


This will require to store useless data in your program and of course it can be avoided. The alternative would be to "pause" the system until the user decides to end the session manually. Just type


system("PAUSE");


at the end and it will pause the program until the user press a key to exit.
Reply:what is the program trying to do, i am a C++ programmer, you can contact me at srp333@comcast.net for help--------------


#include %26lt;stdio.h%26gt;


#include %26lt;windows.h%26gt;


int main()


{


char grade[20];


printf("Please enter your grade: ");


gets(grade);


if(grade %26gt; 10)


{


printf("Your have passed the test.\n");


system("pause");


}


else


{


printf("You havent passed the text");


system("pause");


}


}
Reply:I think it's because the scanf doesn't take the "return" key after the grade : it is still in the buffer, so cin.get() catches it at once, and your program closes without waiting.


In C, you can address the problem in a nasty way by putting a "fflush(stdin);" just after your scanf. There are prettier ways of doing it, but I just can't remember them right now.


I guess if you know the representation of the return key in your system (\n, \r\n, \r), you can make scanf catch it for you at the end of its first parameter (but your code may have portability issues).


C PROGRAMMERS!! homework help please...?

Write a function that, given a 2D array, will determine the minimum and maximum


values of the array. Use the following two arrays:


40 35 30 25 20


20 30 40 50 60


45 55 65 75 85


30 35 40 45 50











200 300 400 500 600


1000 245 78 123 85


981 1001 575 99 333








(a) Use pointer notation for accessing any array elements; don’t use subscript nota-


tion. For example, within your function use *(*(a + i) + j) instead of a[i][j].


(b) Your function should be able to handle 2D arrays with any number of rows and 5


columns. Don’t hard-code array dimensions other than what is required to create


the arrays, i.e., don’t use something like this:


int rows = 4;


int cols = 5;





(c) Print the maximum and minimum values from main()





This Program must work in Microsoft Visual Studio.


Thanks!

C PROGRAMMERS!! homework help please...?
oh hush. he's not going to get a job if he can't do it himself.





void f(int** arr)


{


int max = 0;


int min = 10000000;


int cols = 5;


int rows = sizeof(*(arr + 0))/sizeof(*(*(arr+0) + 0));


for(int r = 0; r %26lt; rows; r++)


for(int c = 0; c %26lt; cols; c++)


{


if(*(*(arr+r) + c) %26gt; max)


max = *(*(arr+0) + c);


if(*(*(arr+r) + c) %26lt; min)


min = *(*(arr+r) + c);


}


printf("Max: %i",max);


printf("Min: %i",min);


}
Reply:You just need to use a double array, Simple homework.
Reply:.section .data


data_array:


.long (your data here)





.section .text


.globl _start





_start:


movl $0, %esi


movl $0, %eax





new_max:


movl %eax, %ebx





loop_start:


movl data_array(,%esi,4), %eax


cmpl $0, %eax


je loop_end


incl %esi


cmpl %eax, %ebx


jg new_max


jmp loop_start





loop_end:


movl $1, %eax


int $0x80





#lol

survey