Monday, May 24, 2010

Exponents in C++?

I just recently started learning C++ and I'm trying to write my first basic program. I decided to make one that would calculate the future value of an annuity when the user enters the present value, interest rate, and time.


Here's the code for the program. (I couldn't put the whole code, so I stripped out all the couts and cins.) The problem is in the 8th line with text in it. I need to make FV = PV * (1 + interest)^months. For some reason I can't use the ^ symbol for exponents.





#include %26lt;iostream%26gt;


using namespace std;


int main()


{


string exit;


typedef float f;


f PV, interest, months, FV;





FV = PV * (1 + interest)





cout %26lt;%26lt; "The future value of your deposit will be: $" %26lt;%26lt; FV %26lt;%26lt;endl;





cin%26gt;%26gt;exit;


return 0;


}

Exponents in C++?
use the math.h library





pow()
Reply:use: f(x)pow(exponent)
Reply:you us math or you do it manually





base, more ,x,y as int





base= 1000$


more= 1000 depot each year


x= 1,065


y=10 years





i=0;


base = base * x


for (i%26lt;y;i++)


{


base = base + more


base * x


}











look like that have fun


if you dont use labrary it take less place and it will run faster


I can't find a good book on C#?

I tried several books , C# For Dummies excellent until you start the OOP chapters. Poorly explained with bad examples.





C# from Sam's is also ok but when it comes to the OOP it use a lot of math examples and does not make its point.





I got Learning C# 2005 from Oreilly , I had no idea that oreilly books assume a programming background. So that one was also a waste of time





Guys any idea where I could get a good book? I check Amazon and found one from Mr Smiley. It is expensise but I don';t know if it is worth to buy. So far I purchased 4 books none can teach me OOP. I am ok with the loping %26amp; all that though.

I can't find a good book on C#?
Hi Joe,


My site below under Computer Talk has a link to a lot of online free books and tutorials that should help get you headed in the right direction. Hope this helps

tropical flowers

Can someone help me with C++?

Hi, i am just learning C++ and 3d mapping... can someone help me either give me a link or explain how to incoperate the map into C++? i know i sound like a total n00b but please help... thanks in advanced

Can someone help me with C++?
try http://www.cplusplus.com it has a lot of information.
Reply:no


Do you know of a c++ interactive training tool?

Hello there, I've been learning c++ from a couple of book for the last 2 weeks. I've read through about 600 page so far, starting from scratch and doing all the examples in the books.





Its proving to be very very laborious and I also can't really afford £1400 for a 5 day course to cover everything.





What would be really good is an interactive c++ leanrning tool, but I can't find one.





Would you know of one?

Do you know of a c++ interactive training tool?
Yes, we call them compilers. And some of the best are free. Check out the links, compilers, editors, IDEs and tutorials on the URL below.


If you are already using one, that is about as good as anyone can do. Some free advice is this: *SLOW DOWN*. It is better, far better IMHO, in the beginning to work through the examples slowly, modify the code so you get a real idea of which statements and variables create / control /destroy what and a *REAL* working foundation. I don't know if this is your first language or your three hundredth, but C++ is too complex to grasp in 5 days, 5 months or even likely in 5 years. Try backing up and reworking through some other tutorials, then back to the book(s) you've already got. Do you know C? How about the Win32s API? MFC? Free libraries of any kind? It is difficult to give advice to someone not knowing where in the process of learning a language they are at. Stay at it, ask questions (smart ones with enough details) on forums and slow up a bit so it absorbs. Good luck!
Reply:You can buy this book


Its really nice and detailed and most likely, the training program that costs 1400 would use this book as a guide





http://www.deitel.com/books/cppsimply1/
Reply:Not an interactive one but i do have an e-book.


if u want it you can select this as the best answer and mail me at ark_alok@yahoo.co.in with a proper subject.


How to move my " Visual C# Express Edition "(the entire working program) from one sytem to another ?

I am currently learning C# on Visual Studio Express Edition


for few weeks on a system.Now i am in a need to work on


a different sytem in which the program is not installed ;


can i simply copy the "visual studio" from "program files" from one sytem to another , i have come to know that program like this e.g .net sdk have their necessary files distributed at various locations (c:\windows\..etc) %26lt;also i want to mention installation via "http://msdn.." again is not feasible%26gt;


...........so please somebody tell me the detailed list of files i actually need to "copy and paste" for the same task ?

How to move my " Visual C# Express Edition "(the entire working program) from one sytem to another ?
It will be hard to do it this way(not impossible but hard). I will try one more time on a system that have Internet to save the package and then copy it to a system without Internet


Easy c++ game ideas?

i recently started learning c++ 3 days ago and i'm interested in making console based games any ideas for an easy but fun game?





thanx!!

Easy c++ game ideas?
My first computer game program was black jack. Who could resist that?





It's nice because it uses just enough tricks and tools for the new programmer:


- random number generation


- get user input (agree to another card or stay)


- storage array for 5 cards


- a loop for getting the 5 cards, and no more than 5 (rules, right?)


- summing the cards, analyzing if user is over, under, Winner





---Easy to expand on the game as you gain programming proficiency:


- play the dealer (computer, or even 2nd user)


- fancy display of cards, instead of just names/numbers


- sounds and images to signal win or loose...


- develop an array of 52 cards that is randomly sorted and picked off, like a real deck...


- develop a betting/payout system...calc odds so payout stays at 15% like a casino...





If you like math, probability, simple gaming, and gathering experince fast with a game you and others might actually enjoy, this could be it.





you go!
Reply:Seems that you are the very beginner, so start simple.





Then try to make some game which requires handling of random behavior, like playing rock, paper, scissors with computer.


Then try to make Snake. It is easiest thing you can try to do.





The next stage is building world. Try to build simple world using sprites and tiles (square images). The game world dont have to be sophisticated, just static images are enough at first time.





Add player actor into the world try to add motion to it: going left, right, up, down.





The hardest part of making game is to add computer controlled actors cos you should consider many things:


- movement (basic geometrics, calculating angle of movement, angle of firing)


- collision detection (what if two actors collide?)


- action behavior (which requires some AI techniques)


- event response (also AI)








Making games even simple one is not easy task. So start small. Then incrementally upgrade your game.
Reply:number munchers
Reply:I thought about doing this for a while, but never got around too it. Make a MUD ! Its all text based, don't have to worry about graphics at all. The user selects actions based on choices you provide and they type what action they want to do.





Could be a real simple MUD





A) Attack dragon using melee


B) Cast Spell


C) Move RightF


D) Move Left


E) Move up


F) Move Down





I was thinking of doing this and making it real simple. Simple spells and weapons. No inventory would be used. No food.





the only tricky part really would be keeping track of where the player was in the room and navigating around the dungeon.

sound cards

Can C++ be used for video game designing?

I'm learning C++ and am curious as to what would be a fun applictaion for it.

Can C++ be used for video game designing?
Yes, it can, and it most certainly is. About 70 percent of commercial games on the market are made in C/C++.





Then again... 99 percent of statistics are made up. :) Lol





Anyway, game designing is most definately something that you can use C++ for, and is a very common use for it.





Have fun!
Reply:not just video game designing but each and every designing.
Reply:Yes, you can do it via c++ with the help of any supportive languages if you want to more help so visit Given URL below





http://www.commediait.com
Reply:check out Blizzard's job postings, see what they look for from people who apply for their programming positions. You see C++ , C++, C++ all the time. ADVANCED SKILLS in C++, X years of experience in C++.





http://www.blizzard.com/jobopp/


C. Describe three strategies for working with children with learning disabilities.?

Multisensory techniques are frequently used for students with Learning Disabilities (LD) and include teaching strategies and materials that stimulate learning by enabling students to use some or all of their senses to:





Gather information about a task;


Link information to ideas they already know and understand;


Perceive the logic involved in solving problems;


Learn problem-solving steps;


Understand relationships between concepts; and


Learn information and store it for later recall.





Students with LDs typically have learning differences in one or more areas of reading, writing, math, listening comprehension, and expressive language. Multisensory techniques enable students to use their personal areas of strength to help them learn. They can range from simple to complex, depending on the needs of the student and the task at hand.





Learning Style Tests http://www.engr.ncsu.edu/learningstyles/...





http://www.scholastic.com/familymatters/...





http://homeworktips.about.com/od/homewor...





http://www.usd.edu/trio/tut/ts/style.htm...


In c++, how do I check if file length is zero?

I am doing a quiz project for the school exam. I have to check if file length of a file is zero ( concept of files). Can I use tellg() ?


I am implementing it in a class .Then I use if() statement to check if file length of a file which stores the quiz questions is zero( i.e there are no questions). If it is zero Then I invoke another function asking the user to input questions first.


Here should i use tellg() to check if there are no questions in the file.








P.s: I don't want it to be too complex...as I've been learning c++ only from june 2006

In c++, how do I check if file length is zero?
This page seems to have what you want.
Reply:May be my blog helps you. I have some code related to file handling in C++ at http://codesbyshariq.blogspot.com
Reply:you can use fstat to check if a file exists. it returns -1 if the file does not exist.





this function also exists on windows.
Reply:Use this method:





======================================...


#include %26lt;fstream%26gt;


int FileSize(const char* sFileName)


{


std::ifstream f;


f.open(sFileName, std::ios_base::binary | std::ios_base::in);


if (!f.good() || f.eof() || !f.is_open()) { return 0; }


f.seekg(0, std::ios_base::beg);


std::ifstream::pos_type begin_pos = f.tellg();


f.seekg(0, std::ios_base::end);


return static_cast%26lt;int%26gt;(f.tellg() - begin_pos);


}


======================================...





Drawback: If the file size is bigger than what int can hold, this method won't work, but in your case, you will be using it to check whether file size is 0, so it will work fine.








If you want to eliminate the limitation of int datatype, and if you are using Visual C++ compiler, then you can use the following function:





======================================...


#include %26lt;sys\types.h%26gt;


#include %26lt;sys\stat.h%26gt;


__int64 FileSize64( const char * szFileName )


{


struct __stat64 fileStat;


int err = _stat64( szFileName, %26amp;fileStat );


if (0 != err) return 0;


return fileStat.st_size;


}


======================================...


How can you make c++ program end itself?

Whenever a c++ program that I make ends, no matter whether it is by using "return" or "exit(0)", it always displays, "Press any key to continue" before the window closes itself. Is there a way to get rid of this message and have the window close itself without having to press a key?


I am just learning c++ and I haven't been able to find the answer to this question anywhere else. I've got Microsoft Visual Studio.net 2003.


Thanks

How can you make c++ program end itself?
this is a default benefit provided by ms. otherwise u need to use getch() to get the output on ur screen or press alt+f5.


if u want to remove it there is pragma supress. but to get upto that point u need to kow a lot. till then keep suffering. :)or use any other compiler like turbo c++
Reply:Miscrosoft Visual studio provide this facility by default .. if u wan to change browse seetings ..if u can't chnage it use other compilers like borland or turbo ..well ur learning ..i think these complilers will make u sense of Basics also .
Reply:use getch()


that shld be fine acc to me.

liama-song

An example of iTunes SDK implementation in C or C++?

I'm trying to control iTunes from a C program, and the simpler way seems to be through iTunes SDK, but I lack the knowledge to do so on my own (just begun learning C). Could someone provide me with sample code, or a better way to achieve this?


Thanks in advance.

An example of iTunes SDK implementation in C or C++?
You really might want to learn C++ first. The SDK will present examples to you, and an API. If you cannot understand it, that means you don't have the prerequisite knowledge to work with it. No, we cannot help you with that. If we present code, you'll give us a deer-in-the-headlights look because you don't know C.
Reply:Believe me it is complex. Why do not you contact a C++ expert?


Try http://expert.myitcareer.org/


Recommended C++ Compiler for beginners?

I want to start learning C++ programing, what compiler can you recommend me?





PS - I use Windows XP 64-bit, so just recommend me a working compiler for the operating system.





Thank You

Recommended C++ Compiler for beginners?
GCC has the advantage of being pretty good in adhering to standards, but if you're used to working under Windows, it may be a bit hard to get used to. You can download it here:


http://gcc.gnu.org/releases.html





Dev-C++ is used quite often, I've seen many people asking questions about it on this forum. You can download it here:


http://www.bloodshed.net/download.html





And then there's Microsoft Visual Studio C++ 2005 Express Edition. This edition is free but has its limitations (compared to a professional edition); on the other hand, if you're a beginning programmer, you won't run into those limitations very quickly. You can download it here:


http://msdn2.microsoft.com/en-us/express...


Look for C++, and don't accidentally download C#; that's an entirely different language altogether!
Reply:GCC


http://gcc.gnu.org/
Reply:I personally used Turbo C complier. Its very good for beginners.


You can easily identify the errors during compilation, i am sure you will love it.





You can download it here.


http://www.pitt.edu/~stephenp/misc/downl...


C++, Getting Started?

I'm a computer science graduate and I'd like to start learning C++, I know about a ton of other languages but my university didn't teach it





where would be a good place to start? and is there a runtime environment I need to download?

C++, Getting Started?
%26gt; where would be a good place to start?





Start by getting a decent C++ book. Google also helps. http://accu.org/index.php/book_reviews?u... is a list of book reviews by ACCU, which checks for technical accuracy. I think C++ Primer by Lippman and Accelerated C++ by Koenig are very good choices. If you have plenty of prior programming experience, then Accelerated C++ might be a good choice for you.





Also keep in mind the C++ FAQ http://www.parashift.com/c++-faq-lite/ . And http://forums.devshed.com/c-programming-... which tells you how to deal with some common basic tasks like file opening and string%26lt;-%26gt;numeric conversion. And cppreference.com because you will want to know what the different parts of the standard library are.





%26gt; and is there a runtime environment I need to download?


C++ gets you a native binary for your OS, so you don't need a runtime environment. However, you do need the set of tools to make a C++ binary. They are referred to collectively as the C++ compiler. Microsoft has Visual C++, which runs only on Windows. Otherwise, it is gcc, which is available for linux/*nix, Macs, and Windows (under the name MinGW).





You'll need a C++ compiler. You most likely will want an IDE like Code::Blocks, wxDev-C++, or Visual Studio if you are using Visual C++. Macs have Xcode. Linux have Kdevelop, Anjuta, etc. You could also use a plain text editor in place of an IDE.
Reply:there are many examples available in the tutorial in the editor.


Or go to online tutorials.


Or buy the balagurusamy book for beigneers and The C++ Programming Language. by Bjarne Stroustrup
Reply:surely a CS grad took C and Pascal, so get a Borland C++ compiler and get a good book at B%26amp;N. That plus 24 hrs (SAMS book) should do it. It's not that hard to get started.
Reply:Check this site out http://cpp-home.com. I too am a computer science graduate and this site was very helpful for finding tutorials, example code, and getting answers to questions in their forum while I was in school.


Which is the best book to start learning data structures and algorithms? simple would be best for me!?

I am new to computer field. And I am currently learning C++.


I heard ,it is better to learn algorithms to do better in this field. I started with Introduction to Algorithms


by Thomas H. Cormen, Charles E. Leiserson, and Ronald L. Rivest.





I liked the book. But I found it difficult to understand. Can someone help me out with some simpler book for algorithms.

Which is the best book to start learning data structures and algorithms? simple would be best for me!?
Hi Devi,





Learning algorithms and learning a new programming language are two orthogonal items. But since you are learning both together it would be nice if you could get hold of a Data-structures book that implements algorithms in C++.





Cormen book is supposed to be one of the best books on the subject. Knuth's books on algorithms are also highly regarded. I have personally found Sahni's book "Data Structures, Algorithms and Applications in C++" to be good. I believe that this book is also available as an Indian edition.
Reply:Well programming is a ton of algorithms, but some algorithms in most books are the more advanced type. I always recommend beginners start with a good beginner "syntax" book, then a good "programming practices" book and last a good "learn to debug" book.





The beginner syntax book should be something like a "Sams teach yourself" series or my favorite the visual blueprint series.





The good programming practices/debugging book should be something like McConnells "Code Complete 2" which is the best book on coding practices/debugging I have ever seen.





Then lastly any real debugging book which has simple examples in your language of choice usually works. If you must have a book title, you could try "the science of debugging" by Coriolis publishing. It is an older book and pretty cheap these days, but has some great stories about debugging mishaps and how to prevent bugs.





I have included some titles that you will find the most useful, not only to learn but also as reference later.





Hope they come in handy. Enjoy!

garden state

C++ into WIN32API?

ok, I am learning C++. How come WIN32 API different.

C++ into WIN32API?
One way to look at it is that you can write your own functions in c or c++, right? Well, the Win32 API is functions that Microsoft has written. They're functions that the OS has exposed to you. You don't really care what language they're written in as long as you can make calls to them in the language you want, like c++. OK?
Reply:I believe its because Win32 is written in the programming language called Basic.
Reply:Because C++ is not the Windows API. Windows programming means using prewritten code to control Windows. The API happens to be available in C++, hence you use C++ when using the Windows API. For example, the Twisted APIs (http://twistedmatrix.com/trac/ ) are available in Python, but not C++. Or WinForms in .NET only. Or many of the Java libraries in Java only.


C programming language?

How do you allow spaces when using the scanf() function??





I'm just learning C, and the part of the book I'm in is teaching about scanf(), but when running the program, unless I only use one word it uses the second word for the next scanf()!!!!!





Here is what happens.





What is supposed to happen is.....





Enter an adjective:Fufy


Enter a food:Marshellow


Enter a household chore (Past tence):Cleaned


Enter an item of furniture:Cair








Don't touch that Fufy Marshellow!!


I just Cleaned the Cair!!





Now what it does if two or ree ors are used....





Enter an adjective:Fluffy Marshmellow


Enter a food:Enter a household chore (Past tence):Taking out the trash


Enter an item of furniture:





Don't touch that Fluffy Marshmellow!!


I just Taking the out!!





So how do I allow spaces??

C programming language?
You haven't showed us the actual code that does the reading of the text...





scanf can do lots of things, it depends on how you use it and what you pass to it that controls what it does.





scanf("%s", ...) will I believe read the next white-space delimited string. However, you should never ever use scanf("%s", ...) because you cannot predict how many bytes it will read so you do not know what size buffer to supply.





The problem you have is that your input is terminated by the end of the line, but you have written code that terminates the input on any white space.





To do it correctly, you need to write low level code in a loop that reads input character by character and puts it into a buffer. It should loop until you get a "new line" character, '\n'. You should make sure you don't get buffer overrun, either by reallocating to a bigger buffer or truncating the input when you reach the limit. You will need to nul-terminate your input string so that you can print it out correctly.
Reply:fstream treats spaces as a new word .......... so to allow spaces you need to replace fstream with other statement like getline


C++ linker errors while writing a header file?

Im learning C++, and trying to write a header file called navtools.h which contains the declarations of some useful functions I have written. whenever i compile my "main.cpp", i get lots of errors like





" [Linker error] undefined reference to `CheckValidLat(float)' "





I tried copying another header file from functionx.com (just to see if it worked) and it also compiles with the same errors! can someone help me out?

C++ linker errors while writing a header file?
Here is what you need to do:





main.cpp:





...


#include "navtools.h"


...


CheckValidLat(5.4);


...





In the same folder as main.cpp, you put navtools.h. If you are compiling with MS Visual C++, make sure you add navtools.h to your project.





Remember that #include (and in general any #-directive) literally copies and pastes the referenced file into your .cpp file. So if you don't have the right #include, then it is as if you are using a function that you didn't declare anywhere.
Reply:Hmm i do programm but not in c++ (YET lol) but here are some tips, is the the heder file in the same folder as the rest of the c++ files??? Might it be a syntax erorr??? In the the heder file are all the filenames right??? Well just keep tryin :).
Reply:Seems to me I had similar errors if I included the header file in the build without including the c++ file that had the actual implementation of the method. Try including the obj file from your compiled useful functions as input to the linker.
Reply:Your main.cpp is calling a function CheckValidLat() that takes a float as an argument. The file containing CheckValidLat() needs to be compiled and linked with the main.cpp.





If CheckValidLat() function is already defined in main.cpp then check the data type of the argument being passed to it.


What is data types &its classification in c++?

iam a beginner of c++programming .





i need online tutorial to learn this data types %26amp; its classification





pls tell me suitable website





also if possible expalin about this





suggest good books for learning c++

What is data types %26amp;its classification in c++?
http://www.cppreference.com/data_types.h...

funeral flowers

4 running a c program?

i have dos operating system in my pc %26amp; i am learning c language but programs are not running on my pc. what things do i need to install,answer me in details as i have no idea about c? can i install it from internet? if yes give me website?

4 running a c program?
download turbo c compiler free from internet
Reply:you have to install a compiler...


turbo C++ will be good on DOS.


try googling.. you will get lot of sites giving details... ;)


borland is one of the best compilers...
Reply:install "microsoft visual c++ software"...u will find it in CD library(shop)...u can also search it in the google search and can download for free.....the steps to be followed are given clearly while downloading....just follow the instructions....and finally dont forget to star my answer.....take care ....
Reply:Install the c++ s/w and if ur familiar with dos operating system u can play "c"
Reply:Hey Neha.. dont panic ;) just install turboC++ and then go on doing your code.. alls gonna be fine.. :)


VB.NET or C#?

Hi, I am making a webpage in visual studio.


The sit e will need some functionality such as user name and password and a photo album etc...





My question is


Should I make it with VB or C#


I'm better at VB but am learning C# in college.

VB.NET or C#?
C# was developed to encourage Java and C++ programmers to migrate to .NET. On the other hand most VB.NET programmers used to be VB 6.0 developers.





VB.NET is easier to understand and learn and VB.NET programmers usually have a hard time working with C#. The converse is not true. C# programmers usually manage to work with VB.NET code.





I suggest you learn C# not because it is superior, but because it is more widespread. Learning C# means you will still be able to write VB.NET without difficulties.





PS: There is a myth that states that C# is faster than VB.NET but this is not true. To be more exact, we can say that VB.NET allows you to take actions that might degrade your application performance. Such actions might not be possible to take with C#.
Reply:If you know vb you can go with VB.net.vb.net Sysntax and logic are almost same except OOPS concept.It's easy to create site when compare to C#.
Reply:C#


VB is dumb.
Reply:well if you know vb, then use that since it will be easier.
Reply:as a .net developer using both languages, i would say to use c#, one as you are learning it at college it will also help you learn c# better.





Also c# is a lot stricter with data typeing and casting of data types, as well as if you learn c# it is similar in many ways to java.
Reply:With those two choices, go with C#.





If you want to try something new and cutting edge, try Ruby on Rails. Visual Studio doesn't generate good code. Better to use a cross-platform, standards-compliant, open-source system.





http://www.rubyonrails.org/





It's free.
Reply:c#
Reply:Actually it is the same if you only use it for designing a webpage (Using ASP.NET), but if you want to use it to make a windows application. It is better to use C#. It is more advanced (and harder to learn) but it provides better memory management and manipulation than VB can do.
Reply:Energizeer Is this about you!??


☆★☆ http://www.osoq.com/funstuff/extra/extra...
Reply:I decided to learn c# even though my background is with VBScript.


I think it is a more advanced language, with more functionality and flexibility, and is used more widely.


If you are looking to work in the area then I think you'll get more money and find it easier to find work.
Reply:VB cos its easier lol
Reply:You can use either to implement your client Although I suggest using a N Tier architecture keeping in mind the importance and benefits of having a thin client.


C Programming Question (graphic output)?

OK, I'm learning C now but want to know how to break free of the command prompt box. In other words, how can I make a graphic user interface for my program?

C Programming Question (graphic output)?
since you're using visual c++, the easiest and fastest way to create a user interface is to use mfc.


1) create a new project


2) select visual c++ in the project types pane, select mfc application in the templates pane. type a name for the project. click ok.


3) click finish.


4) press f5 to compile and run.





this should get you started. you can get mfc sample projects from msdn:


http://msdn.microsoft.com/library/defaul...
Reply:Well, the easiest way is to start with the Win32 APIs. Even though it doesn't seem easy at first, it will start to come naturally with use. The URL below has a good downloadable tutorial on Win32 in C. Try it out.
Reply:We can achieve all graphic outputs only in the command prompt box using C. But we can make GUI by using VC++ (win32 program)
Reply:There is no standard GUI functions in C unlike Java Swing or .NET WinForms. GUI libraries are specific to the platform you are using and most of them are C++ frameworks like MFC and PowerPlant. If you want to learn GUI event driven programming I suggest jumping over to Java or C#/.NET first, get the hang of it, then maybe try doing C++ GUIs.


C++ Store data?

I have been learning c++ by myself. I want to know how can I store data enter by a user in a txt or xml file. I am working in console... I also want the user to be able to open that file.

C++ Store data?
Read about file io online. Its really easy in C++. You treat them just like cin and cout, expect its at a file and not standard input/output.


Check this out to learn all about it.


http://www.cs.hmc.edu/~geoff/classes/hmc...

floral design

C++ console application... where to go from here??

hi.. after learning C++.. it's bad that the best I can do are those console applications.. which is not good looking


I wanna get to GUI programming... if cross-platform GUI isn't easy for now.. then I wanna know how to make a GUI on windows...


and if u would recommend any books??!!

C++ console application... where to go from here??
Cross-platform standard GUIs are AWT, JFC/Swing, Tcl/Tk, GTK+, QT; the first two I know for sure are for Java, Tcl/Tk binding on Windows maybe only for Python and Perl, JFC/Swing is as complete as anyone ever saw and equally good for visual or manual coding. GUI on Windows using Microsoft's way is gotta be visually, then applying some programming hooks in its IDE products. I think the same is happening with Borland's products for Windows, this applies to any language including C++.
Reply:u can learn Windows Programming...


the best book is :





Programming Windows by Charles Petzold.
Reply:Try Microsoft Visual Studio C# Express. Using Mono or DotGnu you can run .Net code on Linux too.





Loren Soth
Reply:use C++ with Visual studio ( express edition - free of charge )


I recommend Java with Netbeans ( full version for free)


Java has a bigger graphic libraries.
Reply:Hi there,





I've seen plenty of recommendations, and here are a coupe more.





Try Borland Builder, it is quite similar to program Windows C++ programs.





Another good point to start is the Teach yourself Visual C++ in 21 Days. It is very well explained and a good point to start.





The thing with MS Visual C++ is that the programming will be abit different. It will remain the same about syntax and programming rules. But for information transactions between your programs and your user interface it will be slightly different from those of console-like.





Well, hope this helps
Reply:learn the MFC and refer any book of C++ gui development


C++ help please!?

I am not getting the average on this program why? my output is 0. what do i have wrong? please be specific with an answer - i am just learning C++ thanx! this is my code:


#include %26lt;iostream%26gt;


#include %26lt;iomanip%26gt;





using std::cout;


using std::cin;


using std::endl;


using std::fixed;


using std::setprecision;








int main()


{


//declare variables


int section = 1;


int gradesRead = 0;


int grades = 0;


double totalGrades = 0.0;


double average = 0.0;





while (section %26lt; 3)


{


cout %26lt;%26lt; "Grades for Section " %26lt;%26lt; section %26lt;%26lt; ": " ;


cin %26gt;%26gt; grades;





while (grades %26gt; 0)


{


average = totalGrades / gradesRead;





cout %26lt;%26lt; "Next grade for Section " %26lt;%26lt; section %26lt;%26lt; ": " ;


cin %26gt;%26gt; grades;


} //end while





cout %26lt;%26lt; endl %26lt;%26lt; "Section " %26lt;%26lt; section %26lt;%26lt; " Average: " %26lt;%26lt; totalGrades %26lt;%26lt; endl %26lt;%26lt; endl;





section += 1;





average = 0.0;


} //end while


cout %26lt;%26lt; "End of the program" %26lt;%26lt; endl;


} //end of main function

C++ help please!?
#include %26lt;iostream%26gt;





using namespace std;





int main()


{


//declare variables


int section = 1;


int gradesRead = 0;


int grades = 0;


double totalGrades = 0.0;


double average = 0.0;





while (section %26lt; 3){





cout %26lt;%26lt; "Grades for Section " %26lt;%26lt; section %26lt;%26lt; ": " ;


cin %26gt;%26gt; grades;








if( grades %26gt; 0 ){


float iRunningTotal = 0;





//read them in and store them (could use a running total)


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


cout %26lt;%26lt; "Next grade for Section " %26lt;%26lt; section %26lt;%26lt; ": " ;


cin %26gt;%26gt; gradesRead;





iRunningTotal += gradesRead;


}





average = iRunningTotal / (float)grades;


}





cout %26lt;%26lt; endl %26lt;%26lt; "Section " %26lt;%26lt; section %26lt;%26lt; " Average: " %26lt;%26lt; average %26lt;%26lt; endl %26lt;%26lt; endl;





section += 1;


average = 0.0;





} //end while





cout %26lt;%26lt; "End of the program" %26lt;%26lt; endl;


}
Reply:I believe the answer to your problem is that you declare totalGrades to be zero at the beginning of the program, and you never change that value, or have the user change that value. you also declare gradesRead as zero. If you are not a big math person, zero divided by anything, is zero, and anything divided by zero is undefined. also, zero devided by zero is not zero, nor is it undefined: it is undetermined. you must have the user changed both of those values to something other than zero. Also, what is the difference between totalGrades, and grades? if there is a certain amount of tests that the user took, maybe ask for the grades one at a time?





e.g.: add these variables





double grade1;


double grade2;





while (grades %26gt; 0)


{


cout%26lt;%26lt;"What was the score on your first test? \n";


cin %26gt;%26gt; grade1;


cout%26lt;%26lt;"What was the score on your second test? \n";


cin%26gt;%26gt; grade2;





average = (grade1 + grade2) / 2





I'm not sure how much that helps or if that is even what your looking for, but good luck. Sorry, it has been a while since I have programmed in C++.
Reply:you calculate the average with this line:


average = totalGrades / gradesRead;





but then you assign the value of zero to average in this line:


average = 0.0;


Try commenting out this line and see what happens.


C# Where do I find a compiler?

I am learning C# and wrote my code in word pad and saved it as a cs file extention. The next step is compile the code from a comand line. Where do I find a compiler? Is there one in Visual Studio? Is a compiler seperate from the visual studio program? My book doesn't give me specifics on the compiler it just tells me the steps on how to make the cs file into an exe file but nothing about if I am supposed to use visual studio to compile. Any help would be great.

C# Where do I find a compiler?
http://msdn.microsoft.com/vstudio/expres...
Reply:Word pad is truly not the right editor to code. You should use a proper IDE (integrated development environment). I find SharpDevelop very useful, it's free, it's fast, it's feature-packed, but not as complex as the 'big irons'. You can compile your projects right from the IDE, no command-line needed.





http://www.icsharpcode.net/OpenSource/SD...
Reply:Please refer to this address and find more information.





http://www.thefreecountry.com/compilers/...





you could find your answer
Reply:There's a list of free ones here. And some tips on the side...





http://www.thefreecountry.com/compilers/...


C++ Beginner?

Any suggestions as to how I should go about learning C++? Suggestions for good books and websites would be greatly appreciated, as long as they assume no prior knowledge of programming as I am clueless in that field.

C++ Beginner?
I am a professional developer and have been writing software for over 20 years now. Presently I do most of my development in C++. I first got started when I was in High-school because I was curious. I started by grabbing a book with sample code in it to pick up the syntax then wrote some simple programs and the rest is history.





The core to learning to program is:


1) Get access to a good compiler (I like MS Visual Studio but it is expensive). Learning to program is a hands-on task. Books are great and I have quite a few but doing is the key.


2) Learn the syntax of the language (any book is good for that - sometimes the shorter, the better). A book that is oriented around the compiler you choose might be a good idea. Something hands-on would be great as well (like "Teach yourself C++ in 21 Days"). Looking at the Amazon.com reviews can help choose a book.


3) Look at some sample code that is well respected and complex.


4) WRITE SOMETHING!!! It doesn't really matter what you want to write, but I would recommend writing something that involves you passion. If you like the net, you could even create you own browser using the Active-X web plug-in in Visual C.
Reply:C++ for dummies. Explains everything in great detail. You actually understand what every lines does instead of "because it does"
Reply:for me C++ was a very easy language. I basically began programming in it after I read a couple of c++ source files. My suggestion is to learn by doing. Go read some tutorials on line and get some good books. There are many good tutorials online for c++. Does anyone here ever try googling their questions?
Reply:C++ is a very difficult language to learn. Go to the link below and read up. As far as learning goes, you're gonna have to sit in a classroom, especially if you have no programming experience. Learning it off the bat is close to impossible.
Reply:Currently I'm reading Beginning Programming for Dummies, which suggests following up with C++ for Dummies. ( I won't be, I don't like this book as it is.) At the same time I'm reading the Head First Series on Html and CSS.


I know these are two different topics, but just speaking on the presentation (hands on excercises, pictures, humor,COLOR)-I like the Head First book a lot more. With the Dummies, I'm already on chpt 9 and I don't feel like I've learned anything useful about programming. Here is the website, you can look inside a few pages from the books as well.
Reply:personaly, i thought c++ was easy, as my first programming language, better than c cus it does more stuff, and better than vb cus that makes hudge files n stuff, and i too started with cprogramming.com and the tutorials there. the hardest part for me was figuring out what compiler to get. i would recomend dev-c++ (yes i know they dont want me to call it a compiler but it does the same thing)
Reply:check this site: http://www.planetsourcecode.com
Reply:C++ is the worst language to learn programming with. Get a Computer Science degree if you don't want to be a hack scriptmonkey. Programming takes a lot of expertise, and C++ takes more expertise than any other language out there.

chelsea flower show

Further my C++,php,asp.net education help!?

I have finished a diploma in web design/development and I'm looking for further education. I'm interested in learning C++ , mysql, asp.net, php.I already know the basics for all of these except C++. Which would be my best option for further study. I was thinking of computer science but i'm not 100% if thats the best choice... maybe a software design course? please help.


Plz help Write a program to calculate (20 number) ! ( factorial) with c?

hi im learning C ( with turbo C++ 4.5 )


our teacher ask us if any one can bring a simple source code of


factorial of 20 digit number i mean ( its over a belion number i think )


he asked us only C code not php or VB or anything else


so if any one can write such a program please help me with it


and i dont need any guide i need the program :D of course i need the headers to becuse i`m new to c and i want to learn the code


( headers like %26lt;stdio.h%26gt; and ...%26gt;


i also found a code in the internet but its a calculator and it has geraphic on it if any one want to watch it go to


http://arashmidos2006.googlepages.com/Ca...


i didnt understand it


ok guys im realy depending on u please help me with this

Plz help Write a program to calculate (20 number) ! ( factorial) with c?
hmm a 20 digit number would be X * x-1 * x-2... x-19





I guess the big question is, does it ONLY do 20 digit numbers? heheh. been a while since i did c, i'm a c# dev... but here goes. Not even sure if a 'long' would hold your result or not...


this won't work if a 'long' won't hold the result, it may overflow.





void main()


{


long value;


long result;


cout %26lt;%26lt; "Enter your number";


value %26lt;%26lt; cin;//can't remember if you can do this in c or not...


result = value;


if(value %26gt; 1)


{


while(value %26gt; 1)


{


value = value - 1;//decrement value


result = result * value;//multiply result by value


}


cout %26lt;%26lt; result;





}


else


{


cout %26lt;%26lt; "Must be a positive whole number greater than 1";


}





}








You know, thinking more about it, i don't think a long will hold the results... the Best way to do it would be a bit array and use binary multiplication. (can't say i remember how to do binary multiplication but it was something we covered in school...)





basically make a bit array that holds enough bits to calculate 99999999999999999999! and do binary math the same as the above code. :) good luck
Reply:Sorry about that. I fixed the problem:





#include %26lt;iostream%26gt;





// Need the climits file in order to know the maximum size of an unsigned


// long int.


#include %26lt;climits%26gt;





// Declare the class.


class Factorial {


public:


Factorial(unsigned short num = 1);


bool inRange();


unsigned long getFactorial();





private:


unsigned short num;





}; // End of class.





// Implement the methods:


Factorial::Factorial (unsigned short num) {


this-%26gt;num = num;


}





bool Factorial::inRange() {





// Maximum possible value for validation.


unsigned long max = ULONG_MAX;





// Loop from 1 to num, dividing the number from max.


for (int i = num; i %26gt;= 1; --i) {





max /= i;





} // End of the for loop.





// Return a true/false value.


if (max %26lt; 1) {


return false;


} else {


return true;


}





} // End of the factorialInRange() function.





unsigned long Factorial::getFactorial() {





// For the factorial.


unsigned long sum = 1;





// Loop from 1 to num, adding the result to the sum.


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





// Multiply current sum times i.


sum *= i;





} // End of the for loop.





return sum;





} // end of the returnFactorial() function.





// Start the main() function.


int main() {





// Declare the variable for the user input.


unsigned short numberIn = 0;





// Prompt the user, take, and validate the input.


std::cout %26lt;%26lt; "Enter a small, positive integer: [##] ";


while (!(std::cin %26gt;%26gt; numberIn) || ((numberIn %26lt; 1) || (numberIn %26gt; 20))) {





// Problem! Clear cin and reprompt.


std::cin.clear();


std::cin.ignore(100, '\n');


std::cout %26lt;%26lt; "I said, 'Please enter a positive integer.' Please: [##] ";





} // End of WHILE.





// Discard any extraneous input.


std::cin.ignore(100, '\n');





// Create the object.


Factorial f(numberIn);





// Print the results.


if (f.inRange()) {








std::cout %26lt;%26lt; "The factorial of " %26lt;%26lt; numberIn %26lt;%26lt; " is "


%26lt;%26lt; f.getFactorial() %26lt;%26lt; ".\n\n";





} else {





std::cout %26lt;%26lt; "The factorial of " %26lt;%26lt; numberIn


%26lt;%26lt; " cannot be calculated.\n"


%26lt;%26lt; "Use a smaller number.\n\n";





}





std::cout %26lt;%26lt; "Press enter. \n";


std::cin.get();


return 0;





} // End of the main() function.


What should I do to practice C# programming?

I am fairly new to programming, and I am learning C# with Microsoft C# Express Edition.





I want to practice my programming skills, with beginner type problems. I can't really think of anything on my own.





Does anyone have any ideas of simple practice programs I could write, or know where I can find a list of "exercises," that will help me impove my programming skills, and begin to introduce me to the important parts of programming.





Ok, I have been in college for two years, but am just about to start on a computer science major this fall, so I just want to get into things a little, learning a little programming. Thanks for your help..

What should I do to practice C# programming?
b practice with MS .net 2005 edition





find tutorial on google .com by writing a key word





C# Tuitorial





www.devasp.com


www.progrmmersheaven.com


www.codeasp.com


www.projectcode.com





find c# code there





rest feel free to contact





ali.shakeel.mir@gmail.com
Reply:purchase complete reference book of c# and read it. and also we will get lots of tutorials for c#.read and practice.
Reply:Plenty of stuff on the web that can help you and its free too.


Here's a few:





http://www.c-sharpcorner.com/


http://www.csharpfriends.com/


http://www.csharphelp.com/


http://www.csharp-station.com/


http://www.ciol.com/content/technology/c...


Can VB work with C++?

I am learning C++ do construct a program that manipulates data. C++ console programming I find is dead easy, but manipluating forms is so much more difficult than VB... should I use VB to manipulate the interface with C++ running all the operations in the background, or would that be just a dumb idea...?

Can VB work with C++?
You can write DLL in C/C++ and call your C/C++ functions from VB code.


Visit the link below to learn hor to do it properly.
Reply:Visual Studio 2k5, it might get messy but in short the answer is yes, if the C++ code is simple just recode to keep things clean

apple

Bypass GameGuard with C++ programming language?

I'm learning C++ programming and i already know those simple looping and those ask user to key in value.





What should i continue to learn?


What program i need to write to do to bypass GameGuard?

Bypass GameGuard with C++ programming language?
just go here link below





http://www.codeproject.com/


Cna we compile c programme in visual studio??

Hi, I am learning c and c++ , I d't have any c- compilers . Can I use visual studio for that.

Cna we compile c programme in visual studio??
yes...you can compile c programs in visual studio...





visual studio's loader will automatically load visual c++, but it should be compatible for the most part...





if possible also (i dont recall if visual c++ does this) but go into the preferences and under the C++ tab or language or somethign like that...it may give you the option to compile Unix C or ANSI-C...pick one of these instead of C++..
Reply:Yes or you can download many free C compilers for Windows or Unix.


Simple graphics in C (windows)?

I need simple and fast graphics libraries for C (NOT C++) for Windows. DirectX and OpenGL are too complicated for me now. I was thinking of using BitBlt, but maybe you have other (better) ideas... Alse, point me too some good sites for learning C.


Thank you, in advance.

Simple graphics in C (windows)?
When you say "Simple Graphics" do you mean in terms of 2D or 3D because when you said DirectX and OpenGL i began to think 3D but then you followed up with BitBlt which, unless their is a program with the same name, that is a graphic processing technique in the 2D realm.





In any regard i'd think it best for you to explore 2D graphics manipulation first before dipping into the deep end of 3D algortihms (interestingly 3D all involves grade 11 math so its not that difficult -- and with DX and OpenGL they do all that for you already).





Ah, i see you mention you dont have C experience. Good idea to stay clear from C++ for now...





A killer book to check out is antyhing from Deitel....oh my god they are detailed in explaining a computer language...to the point of being overkill actually. I am not sure if they do C anymore, but they do have a C++ version which sadly is not what you want :(





Here is a site giving an introduction to C...i just reviewed it and yea it pretty much covers what you need to know:





http://www.le.ac.uk/cc/tutorials/c/


Error handling in C++?

Hi experts!





I'm learning C++. I wish to write a C++ program with exception handling.





Please give a simple program for divisor by zero using C++.


And detail syntax for defining exception.

Error handling in C++?
Unlike Java, C++ does not have a standard exception for divide-by-zero so you have to build your own. Many, arguably all, exceptions in c++ should be derived from the standard exceptions in, oddly enough, the stdexcept header file. Since this is a runtime error this example derives from std::runtime_error.





This should help you get started but it is obviously not a complete treatment of the topic of exceptions. You should read more on your own.





#include %26lt;iostream%26gt;


#include %26lt;exception%26gt;


#include %26lt;stdexcept%26gt;





using namespace std;





class DivideByZeroException : public runtime_error


{


public:





DivideByZeroException() : runtime_error("attempt to divide by zero" ) {}


};








int main()


{


int num;


int dem;


int res;





cout %26lt;%26lt; "Enter numerator: ";


cin %26gt;%26gt; num;


cout %26lt;%26lt; "Enter denominator: ";


cin %26gt;%26gt; dem;





try


{


if (dem == 0)


{


throw DivideByZeroException();


}





res = num / dem;





cout %26lt;%26lt; "Result = " %26lt;%26lt; res %26lt;%26lt; endl;


}





catch (DivideByZeroException %26amp;e)


{


cout %26lt;%26lt; "Exception: " %26lt;%26lt; e.what() %26lt;%26lt; endl;


}





return(0);


}
Reply:#include%26lt;stdio.h%26gt;


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


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


void main()


{


int a,b,c;


cin%26gt;%26gt;a;


cin%26gt;%26gt;b;


try


{


if(b==0)


throw(1);


}


catch(int)


{


cout%26lt;%26lt;"divide error";


}


getch();


}
Reply:use try and catch block. keep the code that causes exception in try block n the code for handling error in catch block.





try{


int i = 5/0;


}


catch(Exception e){ // well this is java code but still c++ code is similar


// handle


}

augustifolia

Is there any C++ IDE on the mac?I really can't understand programming on Xcode?

I'm learning C++ and I migrated from a wintel machine to a mac but I can't find any free C++ IDE on the mac,I was referred to Xcode,but I can't even understand it.I'm looking for an IDE as good as Bloodshed's Dev C++,anyone know where I can find one or help with the Xcode IDE?

Is there any C++ IDE on the mac?I really can't understand programming on Xcode?
If an IDE is confusing you, you should stick to a plain text editor and the console. An IDE is just a fancy environment, providing an editor and one click steps to create a program. Macs have some really good plain text editors. You can take a look on Wikipedia or Google.





But did you take a look at the Xcode documentation? It isn’t that hard to figure out.
Reply:try TextMate


Is there any good chance in IT after learning Java or .net?

I am learning C %26amp; c++. Is there any good chance after learning Java or .Net??

Is there any good chance in IT after learning Java or .net?
C# with .Net is very useful in the workplace
Reply:Learning languages isn't anywhere near as important as learning things like program *design*, requirements analysis, and good technical writing skills. I'd hire somebody who can write and speak fairly well and knows the *principles* of systems design, and a few programming languages than some bozo who knows the language but not how to design effectively.





After all, once you learn "this is a for loop", "this is a while loop", "this is a constructor", "this is a callback reference", and how to use those *concepts* (Wow, a callback lets me implement object-oriented functions by doing *this*) - the language itself doesn't matter. Then it's just "How do I define a callback function in %26lt;language XYZ%26gt;?
Reply:Knowledge of any language(s) does not give you any chance. It just adds you one line in CV.


Your chance is knowledge of programming and it does not depend on any language: it is the way of thinking :-)


Once a friend of mine (fine SW engineer) told me: if i'm able to write application sending "Hello world!" to console, in some language, i know that language.


Java and (especially!) .NET are essentially not languages but sets of libraries, so you need to know API rather than language.


C++ question plzzzzzzzzz?

in c++ i wish to know how to write a program by using CLASS please how to write a programm by class i am learning C++ but i took holiday on that day when they said about CLASS we dont have backup classes because pragrams

C++ question plzzzzzzzzz?
use class operator





classes are very easy and makes program much shoter and easier.
Reply:Go to this link it might help u...





http://publib.boulder.ibm.com/infocenter...


C++ question plzzzzzzzzz?

in c++ i wish to know how to write a program by using CLASS please how to write a programm by class i am learning C++ but i took holiday on that day when they said about CLASS we dont have backup classes because pragrams

C++ question plzzzzzzzzz?
Actually here its quite difficult to teach u but just first of all follow the concept of class then go to how we do it. Generally student dont go to the concept of class that just why we do it rather just structures. So, if you get all about OOPs and ecapsulations then it will be easy to understand how we do it and why we perform it so complexly when we can do it simply.
Reply:A very simple and very straight forward example of using a Class.





First you declare the class. (MyClass)


Specify that the code profiled is public (by using public: )


Define the prototype for your function within the class.


It carries two arguments, Dis1, and Dis2.





Close the class and define the function using the ( :: )


identifier. Be sure to specify the class description before


the function definition.:


int MyClass::MyCalculator(int Dis1, int Dis2)





In the main class create an instance of MyClass and


name it MC (MyClass MC)


Call the MyCalculator function from the MyClass instance


and display its results:





cout %26lt;%26lt; MC.MyCalculator(203, 492);








Here's the complete code:


Enjoy


- Hex














#include %26lt;iostream%26gt;


#include %26lt;conio.h%26gt; //for getch();








using namespace std;








class MyClass


{


public:


int MyCalculator(int Dis1, int Dis2);


};





int MyClass::MyCalculator(int Dis1, int Dis2)


{


return Dis1 + Dis2;


}





int main()


{


MyClass MC;


cout %26lt;%26lt; MC.MyCalculator(203, 492);





cout %26lt;%26lt; "\nPress any key to close...\n";


getch();


}
Reply:classes are similar to typedefs and structs...only they are capable of containing more (ie..contain member functions, constructors, destructors, etc...).





try this:





class myClass { // this is your class...


int aNumber;


char aChar;





int aFunction(){


cout%26lt;%26lt;"one"%26lt;%26lt;endl;


return 0;


}





};





int main(){ // this is your program's entry point...





myClass newClass; // newClass is the new instance..





newClass.aNumber = 1;


cout%26lt;%26lt;newClass.aNumber%26lt;%26lt;endl; // displays a number 1...





newClass.aChar = '1';


cout%26lt;%26lt;newClass.aNumber%26lt;%26lt;endl; //displays a string 1...





newClass.aFunction(); // displays the word one...





return 0;


}
Reply:its a long and most important topic of C++.so u better read it from ur book
Reply:Basically, classes are the basic "containers", or blueprints, for all objects in C++ and other object oriented languages such as Java and C#. I would strongly suggest you talk to a classmate or your professor about this, as it is a HUGE concept, and there is far too much info to post in a forum like this.
Reply:lets first look at the definition %26amp; example for a class


classes are the basic "containers", or blueprints, for all objects in C++ and other object oriented languages such as Java .A class in C++ is an encapsulation of data members and functions that manipulate the data. The class can also have some other important members which are architecturally important.





#include %26lt;iostream%26gt;


#include %26lt;string%26gt;


using namespace std;





class person


{


public:


string name;


int age;


};





int main ()


{


person a, b;


a.name = "Calvin";


b.name = "Hobbes";


a.age = 30;


b.age = 20;


cout %26lt;%26lt; a.name %26lt;%26lt; ": " %26lt;%26lt; a.age %26lt;%26lt; endl;


cout %26lt;%26lt; b.name %26lt;%26lt; ": " %26lt;%26lt; b.age %26lt;%26lt; endl;


return 0;


}


but friend using ur text is the best way to go with c++ if u cant understand it..then ask ur friends or consult ur staff...CLASSES r important topics in c++,dont neglect them.ALL THE BEST
Reply:I recommend you do some serious reading and look at all of the practice code in your book. This is a critical concept in C++ and it's one that can be challenging to get your head around. You won't be able to move forward until you understand it, so plan to invest some serious time and attention. Once you understand it, it's pretty simple.





Here's a helpful link: http://www.cplusplus.com/doc/tutorial/cl...

nobile

Win32 Dev-C++ Programming Tutorials?

Im learning C++ and Im using Dev-C++ and Im trying Win32 but all the online tutorials I find (along with the book I bought) mainly talk about C++ Console Programming and not the Win32 Window programming so can anyone give me some good links as I cant ever right a word in my window!

Win32 Dev-C++ Programming Tutorials?
Well, use Visual C++ Express for that anyway. It's much better and it has an editor and such. At least untill you get a better understanding of how everything works.





You really don't need a tutorial on Windows programming, because to do it you should have enough knowledge of console programming just to read the MSDN site and pick up what you need.
Reply:Dev, by itself helps you to get started. Open Dev up, goto file, create new project, and then select create new windows application. That will give you a bare-bones, ready to compile win32 app. A simple window without controls. To understand how to create controls (ie. buttons), follow the links below. It's not really that difficult to get started, only to master.





http://winprog.org/tutorial/





http://winapi.foosyerdoos.org.uk/index.p...
Reply:exactly.
Reply:Here is a link for setting up Express 2005 to be able to do Win32 programming:


http://msdn.microsoft.com/vstudio/expres...





It involves using the "platform sdk". I've done it, so it does work.





Borland/CodeGear has their Turbo-C ++ ide available for free, and you can do Win32 and VCL programming.


C Program Project?

Can someone help me, I am learning C Program on my own and I am trying to write a program that does the following, that includes fopen(), fclose(), and fprintf(). I can not seem to getting working right. Please help





1. Create a text file containing the following text. “Now is the time for all good men to come to the aid of their country.”





2. Write a C program to open this file, read the contents, and print it to the screen. Incorporate a test to print out the message “No such file found” if the file does not exist.





3. Submit the source file and an executable named “readfile”.

C Program Project?
Too Easy! So I will write a different program





#include "stdio.h"





void createfile( char * fname, char *s)


{


FILE *f = fopen( fname, "wt");


if( f )


{


fprintf(f,"%s", s );


fclose( f );


}


}





void printfile( char *fname )


{


int ch;


FILE *f = fopen( fname, "wt");


if( f )


{


ch = 0;


while( ch != EOF )


{


ch = fgetc(f );


if( ch != EOF ) printf("%c", ch );


}


fclose( f );


}


else


print "Can't open file %s\n", fname );





}











main()


{


createfile( "xfile.txt", “Now is the time for all good men to come to the aid of their country.” );





printfile( "xfile.txt" );


}
Reply:Try this website. It's got a lot of useful information about file streams and IO.
Reply:these r the basics..not a big deal..read low level books like introductory ones..which r for biggners...u will find it very easy..


I am interested in learning programming languages what do I start with Python? C, C++, BASIC, anything?

I'm an amateur. I'm interested making, in the long term, algorithims and software pieces.

I am interested in learning programming languages what do I start with Python? C, C++, BASIC, anything?
I'd start with C# or VB.NET. They're the main languages now for Windows...





You can get the Express versions here for free:


http://www.microsoft.com/express/product...
Reply:You want a simple language with a simple interface to learn the basics of programming. It should be well documented and have a nice IDE. I would stay away from the Microsoft suite because their tools are very powerful and might hamper the learning of programming since you will have to burdened in learning a tool also....So how about Turbo Pascal.
Reply:I have to say I agree with those who say Python is the language to start with. It has a very clear syntax, some great tutorials, and is very powerful.





The main advantage of Python is that once you've learned it you can quickly go on to use it for all sorts of practical functions - you can create websites in it using Django, create graphical software that works on Windows or Linux, and so on.
Reply:You know, I have to disagree with most of the people here (agreeing with one) and say that Python is the best language to start out with. In my experience, Python provides a very comprehensive introduction to programming without getting to bogged down with nuances like types. For example, to make a variable, you just say x = 4. In Java or C/++, it'd look like this int x = 4;. Note the "int" and ";". Yeah, it's good to know C,C++ and the others listed, but the asker's question is which one to START with. And personally, I think Python is the gateway language that will make learning the rest just so much easier. Without knowing a lot going into the game, learning C++ can be difficult. I recommend Python Programming: An Introduction to Computer Science, John Zelle, Franklin Beedle %26amp; Associates, 2004 as a text for learning Python.





I really do think that Python is the way to go, but it all comes down to your personal preference so you'll find what you're most comfortable programming in and that might not be Python, but at least you'll get a soft introduction to programming this way. Good luck!
Reply:Before embarking on a programming language course, learn HOW to program!





I recommend Jackson Structured Programming and Pseudo Code constructions. Algorithmic Programming is better termed Spaghetti Programming!





Once you have mastered these skills, You can adapt your Pseudo Source Code to any language you want.
Reply:Java - you'll get more fun than in c


Visual basic isnt bad either.
Reply:Start with something simple but strong like python, don't use Visual Basic it will cripple your mind lol, once you have learned Python or at the same time learn a stronger language again like C or C++, some people say learn C before C++ but personally I just went straight into C++. C is what is used to make operating systems and if you want to go in to the programming industry then C or C++ is a must, once you learn 1 of them to use the other is fairly simple the code layout is the same just a few things are different. Look at pieces of code and try and figure out how they work if you get stuck or don't understand a piece then go to an online programming forum,google C++ (or python depends on which language your working on ) programming forum, so that's "C++ programming forum", daniweb.com is one and so is cboard.cprogramming.com


At times it may seem hard but push on and once you understand a part that had been confusing you for days you will get such a rush so keep trying and testing out code even if it doesn't work never be afraid to experiment beyond the examples in tutorials.
Reply:BASIC is what I started with eon's ago. Its a good language for a newbie. However, not alot of programs run off BASIC anymore or are written in that language floating around, so its kind of a mute point - unless you want to learn how to program app's for your own personal use. You can learn alot from it though in regards to programming. There are alot of free compilers and tutorials floating around the net. QBasic is the one I think I used when learning.





C++ would be another good one to learn and is still used alot. So your skill's would have more use in today's programming world. Although in my opinion, might be harder to learn/understand programming concepts from a complete newbie perspective then something like QBasic. If you have some understanding of programming %26amp; concepts, give C++ a try. If not, then try QBasic or another variation of Basic.


C++ Problem, please help...?

I wrote this program, first I should say I'm an amature and I'm learning C++.


When I run this program if the input is a letter it returns you havent passed, but if the input is a number then the program halts and got hangged. whats the prob whit this program?


Im using DEV-C++ compiler








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


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


int main()


{


int grade;


printf("Please enter your grade: ");


scanf("%d",grade);





if(grade %26gt; 10)


{


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


system("pause");


}


else


{


printf("You havent passed the text.\n");


system("pause");


return 0;


}


}

C++ Problem, please help...?
Two advices:





1) Always initialize your variables. So:





int grade; // This should be: int grade = 0;





2) Move the "return 0;" statement out of the else-statement


as follows:








else


{


printf("You havent passed the text.\n");


system("pause");


}





return 0;
Reply:looks like you forgot the line "return 0;" after the system("pause"); line in your IF statement. you have it for the ELSE, but not the IF.
Reply:change the statement :-


scanf("%d",grade); to scanf("%d",%26amp;grade);

hibiscus

Changes in c++ ?

I am a neophyte programmer. I can already create functions. I will soon be studying object oriented programing.





I started learning C++ using Microsoft Visual C++6.0 . I recently downloaded Visual C++ 2008 express edition. I discovered that source codes I have written in VC++ 6.0 had some errors when compiled in VC++ 2008. What changes have been made from 6.0 to 2008? If there's a good site please give a link.

Changes in c++ ?
You may contact a c++ helper live at website like http://gionram.com/
Reply:Visual Studio 2008 has C++.net as well. Anything created with C++.net requires the .net framework to run. Same principles as Java.





I don't know about VS-2008, and VS-2003 and VS-2005 will still do the old Visual-C++ as well (without relying on the .net framework). I don't know if VS-2003 to VS-2008 will still let you do command-line C++.





If you're getting errors when compiling, then I don't know. I don't know if VS-2008 will do non .net stuff or not.


I know C and I can use it to create some intermediate level programs! I can use sockets, pointers pretty well!

But I can not make a program to calculate prime numbers or anything that has to do with math! I am really down with math! Kids in my class can make that kind of stuff with math but they can't program at all! they are good with math, I am good with C! Some people tell me that I do not need math and i should go ahead and expand my knowledge in C and othnd others tell meers! I've done that and I am still learning C and I think it is easy and I am loving it! But when at school, I have to do a simple problem with numbers, I freeze! So why do people say that if you want to be good at Programming, you must be good at math! I am a living proof that what they say is not true

I know C and I can use it to create some intermediate level programs! I can use sockets, pointers pretty well!
umm.. unless you end up in writing games or some other sorts of simulations, chances are that you will not explicitly need maths when you have to deliver code.


having said that, I have myself been a strong proponent of knowing maths (And physics) for programmers. if you dont know math, you can often deliver good code to implement a solution that was basically designed by some one else. however, you will almost never know how to compare that with a different solution.


I personally like the designing of a solution as much as coding it.. so I favour learning basic math to be able to calculate the tradeoffs.
Reply:Good with C? great!





A good programmer, ideally gets an algorithm from some place, writes the program and it works just the way the algo works. End of story. This is how vast majority of application developers live.





When you get to serious programming work, such as scientific programming or OS or compiler or toolchain development, you are pretty much on your own. Nobody knows which algorithm works best. Algorithms are taken from math!!! They are pretty much written in a mix of math and a natural language. You will have to develop algorithms. That is to say, you have to speak the language of math!





Now, depending on which of these two programmer profiles suits you best, you can choose to flirt with math or just ignore it.
Reply:i was (and still am) bad at maths, but good at programming. so it's not true what they say :)





(and i have a good job as a C programmer.)





sometimes, when i don't understand something mathematical (i.e. an algorithm), i write a program (in C or python or perl) which implements the algorithm. and then i can understand it.
Reply:Some programming is about math. Some programming is about managing information. There is some overlap and knowing both is always helpful.
Reply:yep, i have the same sentiments.... they even told me that the rationale was that if your good at math, then your good at analysis... i really disagreed! but we have to agree that being good in math does have an advantage especially in writing complicated programs.


I have just finished introduction to C++ 1 and 2 at my school, what should I do next, C++ wise?

I won't be learning C++ really anymore for a long time, what should I start learning now, C++ wise, because I already pretty much know all the basics and what not.

I have just finished introduction to C++ 1 and 2 at my school, what should I do next, C++ wise?
well, take it from a guy who's been surfing the technology waves for 10-15 years, the answer to this lies in assessing the next flavor of the month, and has gotten very difficult to predict lately. c++ was super hot, then OOP and java, then J2EE followed by ANYTHING with a J in front of it, then .NET and C#, meanwhile XML and Web Services were thrown into the mix. C++ is now "old technology" and probably laughed at by some yet will always be violently defended by those who grew up with it.





I code in Prolog and perl, just because i am sick of reading a flavor of the month book every 2 weeks and i actually want to create, not memorize and mimic. But i do not recommend these languages career-wise because few people actually look for these key words. i do it because i HAVE a job and i could care less about learning the newest way to do a frikkin for-loop -- useless!





But certainly don't follow my lead, in fact i'd consider moving to Java or C# for job security, but listen to some podcasts or read slashdot and see how c++ is holding up. No doubt it will be deprecated some day, but you need to judge just how soon it will happend so you can jump to the next merry-go-round.
Reply:You might want to go to C# if you're looking to stay with Microsoft crapola. Object orientation is the future, my friend, and C# is object-oriented from the beginning. (Java was object-oriented from the beginning first, though!)
Reply:Many c programmers view C++ as just a way of organising their code into groups (classes). The code that they write is syntactically correct but does not use the real power of C++.


If your C++ classes did not cover it. I suggest learning Object Oriented Programming to unleash the real power of C++.
Reply:Take a Java course. Also look into maybe learning about databases. Programming languages and database operations go hand in hand and you need to know how to retrieve and modify data on a database using your application.
Reply:There are two ways to look at C++ and many schools teach only one way.


Many c programmers view C++ as just a way of organising their code into groups (classes). The code that they write is syntactically correct but does not use the real power of C++.


If your C++ classes did not cover it. I suggest learning Object Oriented Programming to unleash the real power of C++.


If you want to learn another language that is truely an object oriented language, try Prolog. It is the best language, it uses Object Oriented Programming and only OOP. It is the best language for intelligent processing of data.
Reply:yea i would learn c++wise because it wont do any harm to know more in fact the more you learn the better your job prospects,


good luck for the future


Should I use C or C++?

I'm a software student and have studied some C. Now Should I finish C to the end or start learning C++? (I'm free to choose what 2 do!)


Thanks

Should I use C or C++?
c++ is an addition on top of c. I think you should continue on with c and really master it. Once you want to start learning c++ you'll be able to focus on the differences, with a full understanding of the underlying mechanims.





There is also a giant library of c code out there, and fully understanding c is extremely useful.





WIth that said, most modern software these days is being written in an object oriented language (c++, java, c#, ruby etc.), so you will need to study and master oop, but that can be a long process, and lead you to design patterns, and topics that go far beyond the simple mechanics of the language.
Reply:finish c cuz c++ aint that difrent
Reply:Go with C++ as you will learn the higher thing now as you might have got the base idea so going for C++ would be a good idea and it is not that tough too as i never did C in my life and directly did C++. Best of luck.
Reply:Have a look at C# instead.
Reply:learning c is not at all necessary for c++ it just depends on what you want i would go with c++
Reply:Go with C++, it is based on C with lots of extras.





Anyway, C is not object-oriented Lang. C++ is. Also learn C#.
Reply:I'd say stick with C if your interest is hardware. It's useful for a lot more than that but really shines these days in embedded hardware and driver programming (like graphics). Otherwise there isn't that much difference and you're going to find yourself using standard c libraries like stdio.h (as cstdio) and math.h (as cmath). I just answered a question the other day (and almost certainly did NOT give the best answer) where the questioner identified the subject as C++ but the function he was trying to use was sprintf() from stdio.h.





For small, economical programs which really drive the hardware, stick with C, but C++ has an awful lot of power, and you will have to go back to C occasionally anyhow.

hydrangea

C and C++ language book suggestion..?

Will anybody please suggest a book which is best in learning C and C++.. Something which is available worldwide.

C and C++ language book suggestion..?
My all-time favorite programming language books are How to Program books by Dietel and Dietel. They have "How to Program: C" and "How to Program: C++". The Dietel and Dietel books are my favorite for the main reason that they are pretty easy to understand and they are also pretty much complete. Also, they have quite a number of useful source codes and examples.
Reply:how to program?c/C++ Deitel and deitel


complete reference by hebert schildt
Reply:Use Schaum's Serires for C-Lang


C++ Complete Reference (Herb Schield) and C++ Unleashed. for OPP with C++
Reply:you won't learn too much, use the internet and practice, practice, practice





www.cprogramming.com


www.programmingtutorials.com


www.programmersheaven.com


www.thecodeproject.com


www.gamedev.net





for free utilities and compilers


www.thefreecountry.com
Reply:if you want c++ book i have a really good one and its free its an ebook and pretty famous all over the world just mail me





subject should be "c++ book"





at firozahmed143@rediffmail.com
Reply:programming in ANSI C - E.Balagurusamy


programming in object oriented language(C++)


- E.Balagurusamy


the above books are very easily understandable for beginners in c and c++.