Sunday, August 2, 2009

C programming: how would i go about this question:?

I'm trying to help my friend out with this and we cant get it working. How would you go about doing this?





1. Write a C program that opens two data files one for reading and another for


writing. The program must copy the contents of input data file to output file


with the data double line spaced. Example below. The program must work


for all data files [ and not just for the following example ]





Input file:





Earth is Solid


So is Moon.





Output File:





Earth is Solid





So is Moon.

C programming: how would i go about this question:?
If ur talkin bout c++ then its here:





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


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


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


class handle2files


{


public:


readnWrite();


};


void handle2files::readnWrite()


{


ifstream inputfile;


inputfile.open("filename.ext");


ofstream outputfile;


outputfile.open("filename.ext",ios",io...


char ch[300]; //to temporarily store each char from input file


while(inputfile)


{


inputfile.get(ch[i]);


if(ch[i]=='\n') signal=-1; //one line read


cout%26lt;%26lt;ch;


if(signal==-1)


{


ch[++i]='\n'; //this is to add one more line gap(doubled gap)


outputfile.write(ch,sizeOf(ch)); //line written into output file


signal=0; i=0;





}


}


inputfile.close();


outputfile.close();


//done!


}





void main()


{


handle2files object;


object.readnWrite();


getch();


}
Reply:Open the input file for read


Read the first record


If end-of-file


print error message


end-if


Open the output file or write





Loop until end-of-file


output = input + '\n\n'


write output file


read input file


end-loop





Close input file


Close output file





That should do it.
Reply:Computer Tutorials, Interview Question And Answer


http://freshbloger.com/


How can I write a program in c++ that can create its own variables?

I want to write a program in c++ that can declare new variables for iteself, and thus be only limited by a computer's memory. I am fairly new to programming in general, so I was wondering if there was a simple answer or a bit of code I could past in.


Thanks! :)

How can I write a program in c++ that can create its own variables?
Create a dynamic array, with three dimensions, or three seperate dynamic arrays. Use one array to store variable names as a string format, and one to denote variable type, use string for human readable assignment, or use a char array for symbol codes. Then finally, use the third array to store the value, preferably in string form.





Create functions to manipulate these variables, expanding and contracting the arrays when needed.





Good luck!
Reply:O'Neill's answer might be a little overpowered for what you need to do.


In C++ memory is dynamically allocated using the new operator (although, the C malloc() function is still available). So if you want to create an int, you would do it like so:


int *pint = new int;


Yes, you will still need to create the variable pint, but that won't be the int, it will be a pointer to an int. The int would be *pint.


When you are no longer using that int, you should deallocate the memory with delete pint.
Reply:#include %26lt;iostream%26gt;


using namespace std;


int main()


{


cout %26lt;%26lt; "Enter number of variables to create" %26lt;%26lt; endl;


int NumberOfVariables = 0;


cin %26gt;%26gt; NumberOfVariables;


int *VariablesHere = new int[NumberOfVariables];


}

pistil

Can someone tell me what each programming language (C++, Java, Cocoa...) "does" in lamens terms?

I am interested in learning how to program on my mac. I would love to learn how to physically create or make something happen on my mac, even if it is something little. For instance, the language I would like to learn is a language where you do all this coding and run it. When the code is ran, say a box pops up and says, "Hello, how are you today?" and in that box, there are three buttons, one that says, "Fine," another that says, "Not so good," and another that says, "Leave me alone!" I want to learn a language that "Creates" something when it is ran, no matter how simple or complex it is. Can all languages do what is mentioned above or is each language used for a specific thing like more complex (making your computer talk to your printer etc.)? Can someone give me a short brief of what each programming language (C++, Java, Cocoa or something other) does or what it is used for? What's a good first language to learn? Also, I'm a mac user so if there are any mac spec. stuff--great

Can someone tell me what each programming language (C++, Java, Cocoa...) "does" in lamens terms?
Ok, so it sounds like you are looking for a programming language for the Mac that can create GUIs (Graphical User Interface). I'll try to give you synopsis of the languages that I'm familiar with from that angle:





1 - C++ - This is a very powerful language that can do A LOT of things with your computer. It is also very easy to create "buggy" programs with this language. Nonetheless, many professional programs are written in this language, but I would say that it is not for "casual" beginners. As far as GUIs with C++ go, I'm only familiar with Microsoft's "Visual C++" for Windows, so no help there (same for Microsoft's C# language). You can probably do Mac GUIs with C++, but somebody else would have to help you with that.





2 - Java - This language is heavily influenced by C++, but is also designed to be "safer" (less likely than C++ to cause memory problems) and also "machine independent." That means that you don't need to change the program to get it work on a Mac, Windows, or Unix machine (I'll spare you the explanation of Virtual Machines). Programming GUIs in Java should probably be pretty universal.





3 - HTML and JavaScript - I mention these two languages together because (A) I know them, and (B) they can be used to create "web applications." I'm not sure if that is something you are interested in but there is a lot of information out there on these guys that you can study from. JavaScript is a lightweight version of Java that can be used to change HTML on-the-fly. You can also embed Java "applets" into HTML pages. Again, these languages are pretty universal and should work well on the Mac.





4 - Perl - The final language that I'm going to suggest to you and also my personal favorite. An easy enough language for beginners to learn, but powerful enough to write fully functional programs in. For GUIs, you're going to use something called Perl/Tk (the Tk stands for toolkit). If you're willing to invest in a couple of thick O'Reilly books, you'll have just about all the information you'll need to program in Perl and Perl/Tk. Those books are "Programming Perl" and "Mastering Perl/Tk".





So, I hope that helps. I know it's a long answer, but I think it's what you're looking for.


Where can I find a simple linear regression program in C++?

I am trying to learn how to use C++ programming on my own. I have already created a mean and standard deviation program using a basic knowledge of math and the help option on the program itself. I would like someone to show me a sample program they have made to find linear regression so that it would help me understand the programming language better, because I cannot get my linear regression program to work. Thank you very much to anyone willing to help me.

Where can I find a simple linear regression program in C++?
the answer is on the website





http://www.codecogs.com/d-ox/maths/regre...


How in C programming,we can assign a float value to a char value?

like if i calculated the any value ,whose result is ,say,17.346 then how can i display it in a function outtextxy() ???

How in C programming,we can assign a float value to a char value?
Can't be done - there aren't enough bits in a char for a float, a float (usually) takes 32 bits. If your variable is an int you can do it with a cast, but that is extremely discouraged.





Actually, what you mean is not char but char *, address of an asciz string.





What you need to do is use something like sprintf() to make a character string of the value, and then use that.
Reply:You can't do a float to a char but you can to a string.





char buf[80];


float fred=2.345;





sprintf(buf, "%f", fred);





buf now = "2.345"





use "%x.nf" where x = size and n is no of decimal points for instance





sprintf(buf, "£.2f", fred);





will produce a monitory output.


Hi, can somebody help me with this.. (programming C++)?

It's in C++, can somebody tell me how to manipulate a html page and code it in C++ like for example: In a registration page, instead of going in there and registering how can you code a program to make it do it for you? With you entering the details on the program you have written it on of course.

Hi, can somebody help me with this.. (programming C++)?
Using CGI, that is lot of work, may be you can contact a C++ expert at websites like http://askexpert.info/

house plants

*************** programming C++****************?

i have an assignment for this week which is Write a program that reads in a five-digit integer and determines whether it is a palindrome. the instructor wants us to check to make sure that the user inputs a 5 digit number. It means that if user enter a character or press enter instead of a 5 digit number, the user should get a prompt that says "please enter a number."


is there any code for this in C++. i already tried the .length() but seems like this code is for the character and strings.


can anyone help me with that please? :)

*************** programming C++****************?
I have nothing to add on the other guy but I'll explain a little if ((x / 10000) %26gt; 0 %26amp;%26amp; (x / 10000 )%26lt; 10) verify that it's a 5 digits number you can replace it with ((x%26lt;100000)%26amp;%26amp;(x%26gt;9999)) but I advise you to make the input a string because later when you check if it's a palindrome it will be easier with a string


I hope you understand
Reply:unsigned int x = 0;


bool a = false;


do


{


cin "Enter a 5 Digt Number: " %26gt;%26gt; x;


if ((x / 10000) %26gt; 0 %26amp;%26amp; (x / 10000 )%26lt; 10)


{


then a = true;


else cout %26lt;%26lt; "Invalid Number!";


}


}while(a == false);


I am asking for a good and very advance C programming reference?

i need a refrence (book or e-book) include not only pointers, classes and ......


but also system calls, threads, hardware instruction, C over UNIX and ......

I am asking for a good and very advance C programming reference?
You can check free ebooks websites like http://myitcareer.org/


Im trying to write a C program that outputs a bank statement?

The user should be allowed to enter a begining balance and the transaction one at a time. When the transaction is a deposit, the user precedes the transaction with "D" and withdrawal with "W" and a check with "C" and should include the check number. The program should report all transactions and the final balance.

Im trying to write a C program that outputs a bank statement?
//This'll get you started:





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


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


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


#define MAX_ENTRIES 500 //enough for 500 entries





struct tagRecord{


char TransType; //...W, C, or D


float amount; //dollars and cents


}Record[MAX_ENTRIES];





int main()


{


int i;





//clear/init the Record database


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


Record[i].TransType = 0;





printf("\nEnter Transaction Type: ");


Record[0].TransType = toupper(getch());





printf("\nEnter Amount: ");


scanf( "%f", %26amp;Record[0].amount);





for(i=0; Record[i].TransType; i++)


printf("Transaction Type: %c Amount: %.2f \n",


Record[i].TransType, Record[i].amount)





return 0;


}
Reply:Can you be a bit more specific with the part you are stuck on? Nobody here is going to do your assignment for you! You need to use scanf or a similar function to read the data in and perhaps an array of structures to store the data
Reply:get a variable to read the balance as an integer, and a variable to read the transaction. then program it to check what the first character is. after extracting the character, use an if statement or something similar (select case, *** loop, etc.). to make the output look better, code it so that the defining symbol (w for withdrawal, d for deposit, c### for check) is removed before recording it to the file. if you don't want to write to a file, store the transactions in an array after the program is done with them.


Source code or a sample program in C programming that implements INSERTION SORT.?

I really need a sample program in C programming that uses INSERTION SORT.Can you please help me? Thank you so much.

Source code or a sample program in C programming that implements INSERTION SORT.?
http://en.wikipedia.org/wiki/Insertion_s...
Reply:Do not copy your project assignment from internet you will get caught, either code it yourself or contact a freelance programmer to help you out. Check websites like http://askexpert.info/

garden centres

Free Linux C programming software?

Does anyone know of any website to download FREE Linux C programming software? I want to learn Linux C programming but I don't know any website.

Free Linux C programming software?
A good site for further learning is:


http://linuxcommand.org./
Reply:Your distribution's repositories should be having Anjuta, gcc, g++, libc, libc documentation and Vi and Emacs. Install these softwares.





gcc and g++ is compiler for C and C++ respectively.





libc is the standard C library.





Vi and Emacs are both legendary text editors that can be customised to work as IDE among many many other things. Learning curve is steep for both. The return of investment is higher than other IDEs as well.





Anjuta is a GUI based IDE for C and C++ primarily.





Besides these, use good books to learn C.
Reply:Your Linux distribution almost certainly includes everything you'll need to get started! gcc is the GNU compiler collection, which includes a pretty darn good C/C++ compiler. There's lots of great editors - vi/vim, emacs, probably some graphical stuff I'm not familiar with. That's about it - contrary to marketing, you don't really need anything more to develop programs, and anything more can actually be distracting when you're trying to learn.
Reply:Anjuta is a free IDE for C/C++.


C programming continue loop?

How do I add this statement in a c programming structure?





"Prompt the user to enter 'c' to continue or 'q' to quit"





I suppose you would use some sort of loop but im not sure how to impliment it.

C programming continue loop?
you can have a while loop based on flag 'keep_going', set keep_going to 'c' and as long as keep_going is equal to 'c', run the loop. If you need to only quit if 'q' is typed and not some other letter, then you could say, while keep_going != 'q' and then do a check inside your loop to make sure it isn't some other random letter either.
Reply:Try using a printf followed by a getchar.





You can wrap them both in a do while loop waiting for a valid answer to be entered.


Going to be going from visual C++ 6 to C# and 3D game programming instead of 2D, anyone got any tips?

Used visual c++ 6 and soon we will be coding in DirectX(to learn) and Reality(to create the game in a 3D world and light it etc, put in game physics an all).





Any tips anyone can give me?

Going to be going from visual C++ 6 to C# and 3D game programming instead of 2D, anyone got any tips?
Sounds cool! I think you'll have a good time. If C++ is very familiar to you, there are probably some things about C# that you'll find annoying. Read up on the .NET CLR, which is the basis of the biggest changes between VS6 and the .NET platform. Fortunately C# is, for the most part, a superset of C++, so most of what you already know will still work.





The DirectX API is pretty straightforward. I much prefer to work with OpenGL, but for Windows-only development DirectX is about as good as it gets. I've never worked with the Reality engine but have heard good things.





Tips? I'd say get a good book on C# for C++ people (there are several out there) and another one on DirectX (make sure it's aimed at C#/.NET and not VB or something). As far as the skill set you'll need, I think you're probably already there if you're decent with Visual C++. You didn't mention if this a solo project or a work thing, but if it's the latter then you'll have the expertise of others to draw from as well.


Pointer to a pointer in C programming?

can you please explain to me the advantages of using pointer to a pointer in C programming?.





I also dont know how i can use them.


try to give me an example.

Pointer to a pointer in C programming?
Here's the deal - pointers to pointers are the SAME as multidimensional arrays in any other language.





Consider this:


int[][] matrix;





This is a 2-d array of numbers, such as a reachability matrix for a graph. You need this 2-d array to perform operations such as finding the shortest path between 2 points, or finding the number of distinct paths, or any other graph-operation.





You can use pointers to pointers to simulate this kind of 2-d array. Look at this for more info:


http://computer.howstuffworks.com/c32.ht...
Reply:There are a number of applications the most common is to assign a ptr in a function.


e.g.





int assign_ptr(int **a)


{


*a = malloc(8);


return 1;


}


yeah it's a nonsense example but it shows the point.

flower menings

What does the <<= operator do? C Programming?

In c programming what does the %26lt;%26lt;= operator do?

What does the %26lt;%26lt;= operator do? C Programming?
Assignment by Bitwise Left Shift. It shifts all the bits in a value left by one and assigns it to a variable.


Programming c subvectors?

i am using C and i need help with subvectors, i have to make a program that does the following





A file contains a list of integers. The integers can, and are likely to, contain a mix of positive and negative values. The name of the file comes into your program via argv[1].


The first n numbers of the file are read by your program. The number n comes into your program via argv[2]. The number n will be no greater than 200,000.





For example, the file could contain the values:





-3 100 -4 -2 9 –63 -200 55





Your program will output a number that is the largest sum found in a subvector of this list. In the example above, the output would be 103 since that is the largest sum that can be formed by adding the elements of any subvector.





A subvector can be the entire list, a single member of the list, or it can be any collection of adjacent numbers. If the entire list of numbers contains negative numbers then your program should output 0.





Here is another example: 1 4 3 -4 8


The answer in this case would be 12 since the entire list of numbers forms the maximum sum.

Programming c subvectors?
#include %26lt;stdio.h%26gt; /* Include lots of standard definitions */


#include %26lt;stdlib.h%26gt; /* Get more useful definitions, like atof() */





main(argc,argv) /* Operating System supplies argc %26amp; argv */


int argc; /* The number of words in command line */


char *argv[]; /* The sequence of words in command line */


{ /* argv[0] is the program name */


int i; /* a loop counter - always an integer */


int highest; /* Highest number*/


int high2nd; /* 2nd highest*/


int temp;


double x, sum; /* working variables, double precision here */


sum = 0; /* Initialize sum to 0 */








for( i = 1 ; i %26lt; argc ; ++i ) { /* loop over args[1,...] */


x = atof(argv[i]); /* convert a string to a number */


if(x%26gt;high1st) {


temp=highest;


highest = x;


x = temp;


}


if(x%26gt;high2nd) {


high2nd=x;


}





}


sum = highest+high2nd;


printf("SUM:%i\n",sum); /* print sum after the loop completes */


}
Reply:You know, the problem here is that us real programmers, although we love writing code, couldn't be bothered to write programs to solve such trivial problems.





Which aspect of the question are you having a problem with? Arrays ("subvectors") can be a bit weird in C sometimes.

blue flowers

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


How can we go from one window to another in windows programming in C???

for eg. if in 1 window there is a option of "start'...by clicking to the 'start '..a new window should open...Plzz provide the code for this in C language...

How can we go from one window to another in windows programming in C???
Perhaps the URL below can get you a good answer, if you are concerned with Win32 API programming, that is. Good luck.


What are the best web sites for C programming?

kind of sites where you can research for source codes and get variety of sources.. and topics in C as well.. i am looking for site that is clean and spam-free(is that what you call it?) .... i am working for a project and it needs lots of styling ang coding, you know... do tell me if you know... thanks...

What are the best web sites for C programming?
http://www.cprogramming.com/tutorial.htm...


http://www.learn-programming.za.net/prog...


http://www.cyberdiem.com/vin/tutorials.h...


http://www.obsolyte.com/learnc/


http://www.phys.unsw.edu.au/~mcba/c001.h...


http://www.cs.cf.ac.uk/Dave/C/


http://www.phim.unibe.ch/comp_doc/c_manu...


http://www.paulgriffiths.net/program/c/


http://people.scs.fsu.edu/~burkardt/c_sr...


Whats the best resource for windows programming in C++?

Hello, I wist to start programming windows apps in C++. How did you learn to program in Windows? (What book, Websites?)





- Cheers, Daniel

Whats the best resource for windows programming in C++?
Charles Petzold wrote several programming in Windows books for beginners. They are well written and easy to understand. They are for C programmers only though. Windows doesn't run C++ apps native. You have to use the MFC wrapper to get them to work properly. C programs run native.
Reply:First, if you are not familiar with C and C++ both, then stop, back up and start with them in console mode. You'll need C to use the Windows APIs directly, though it will work fine in a C++ compiler with the right options set. Links to good things for free can be found at the first URL.


Second, if you are already familiar with C++ and C, then try the excellent tutorial available at the second URL. It deals very well with familiarizing you with the concepts of API programming in the Windows environment. I hope this helps you out.
Reply:don't start out with wondows programming. start with C++ programming in general





once you understand that, move into the COM/MFC/ATL/WIN32 programming





try http://cplusplus.com for a few good tutorials





the Bloodshed complier is good fre IDE, also Visual C++ Express is free and give you the full power of Visual Studio when you are ready for Win32 apps.

white flowers

What is the use of unsigned and signed integer in c programming?

In computers, all data is a certain number of bits (1s and 0s) and there are 8 bits in a byte. An integer is 32 bits (on most CPUs). With a signed integer the first bit represents whether or not the integer is positive or negative. With a signed integer the range of values are -2,147,483,648 to +2,147,483,647. However, lets say we were making a computer game and we wanted to keep score but we want to account for the fact that our player is a very good gamer and could get a very high score. Well, since our score will never be negative (only zero), we can use an unsigned integer. What this will do is create a number that is only positive (like absolute value) and use that extra bit (previously used to describe whether or not a number is positive or negative) as part of the number. Thus are new range of integers is 0 to 4,294,967,295.


What are the better programming languages for getting hired for a computer job?

What are the better langauages to get hired with JavaScript, Java Programming, C++, FrontPage, Linux, Fortan, Cobal, HTML, Visual C++, Oracle SQL ?

What are the better programming languages for getting hired for a computer job?
You are probably going to get lots of opinions!





Frontpage and Linux aren't languages.





Javascript is required for any web devlopment





Java is the cobol of the '90s. Popular now, but it will be eclipsed by newer languages.





C++ is a great intro to object oriented programming, and currently the best language for writing desktop apps.





Fortran, Cobol and others belong in history books, nice to know but very few practical uses these days.





HTML is not a programming language. It's a markup language, and coupled with XML it is a requirement for any job!





Visual C++ is a microsoft version of C++ , great for building games or program that croak on each new release of MS software!





SQL again is not a programming language, but the most prevalent database query language.





all the languages you mentioned are products of the last millennium! the world changes quickly!





Python, Ruby, PHP, Perl, XSL, and others are the current choices for large projects.





Any language will have a niche market, but to get the good jobs, you need to know at least 4 programming languages, and the major packages that are used with them!
Reply:When comparing programming languages, quite a few share similar syntax or keywords. The difference lies in the order or format that they must be written in. For example Java, Visual C++ and C++ use very similar syntax to make reference to methods and declaring variables and are considered Object-Orientated languages. Simlar can be said about Oracle SQL. Because SQL is a standardized query language for databases, a heavy portion of the langauge is interchangable with variances of keywords when comparing TSQL to MySQL to Microsoft-SQL and Oracle SQL.


Fortran and Colbal is still used, but you'd see it in more in scientific research fields. Linux is an operating system just like Windows is. It has many variants that share similar interfaces and console commands, the major difference lies in it's intended purpose from scientific research to more media and overal-user support.





Ok now regarding what is best for a job:





-%26gt;Knowing HTML and SQL is benificial. Because most businesses are web-based and looking for dynamic websites, The background of these two languages will make it easier to understand how server-side scripting acts as a translator between the two. Server-side scripting languages include PHP, ASP, Python and Pearl.


Theses languagues submit information to the data base using SQL and then retrieve and translate results into HTML for the webserver to present to the user. Though PHP and Mysql are highly used and open-source, there are many employees looking for skilled individuals who know VB.net and SQL or Oracle devlopment. VB.Net is a revised version of Visual Basic that supports a more object oriented aspect and holds some minor similarities to C++. VB.Net is also a component of ASP making it ideal when using it to interface between a webserver and a database. And for this reason I've seen quite a few classifieds for Oracle and VB.net skills.





-%26gt;Regarding Linux operating systems with it's many flavors: popular ones to consider becoming familiar with: Ubuntu, Fedora, Red-hat, Gentoo, Open Suse





-%26gt;Java and Javascript in general is a good language to learn because it can function regardless of the host's operating system and is responsible for performing a lot actions within a dynamic website such as forms and fields. It is also a component of ASP.net just as VB.net is as well





-%26gt;Frontpage? Well, given the situation that it is to your benfit to know HTML. Frontpage and other (WYSIWYG) editors such as Dreamweaver should be more of cake walk, once you grasp the HTML concepts behind them.
Reply:Java (a simplified version of this is used for Smart Cards)


HTML for web sites


Visual Basic for gaming


What do i need to start programming in c++ and from where?

1. A computer running either Windows or Linux. I'd suggest Linux because most Linux distributions come bundled with a free C++ compilers (G++ or GCC or both). If they don't you can download these compilers for free of the net. Programming is the LINUX/UNIX environment also takes away the comfort of having a nice UI like Visual studio would on the Windows environment which means you get better at debugging programs and also writting code the hard way. So when you switch environments it becomes easier since you've already been to hell and back.





2. Get a book on C++ and start writting some basic commands to get your feet wet and to mainly learning the syntax of the language. I'd recommend the book written by Tony Gaddis think it is called beginning C++. Its got plenty of examples and is a fairly easy book to understand.

What do i need to start programming in c++ and from where?
I'm sorry i really cant b of any help here.
Reply:Go to a book store and get a book on visual c++. Sams have written a few, and I bought one several years ago that came with a c++ compiler. Other than that, search the web for a free compiler, it may not have all the features, but it would get you started.


Could some one suggest good c++ libraries for scoket programming?

could anybody suggest me good tutorials for winsock programming using c++...............

Could some one suggest good c++ libraries for scoket programming?
http://netclass.sourceforge.net/





or





http://www.alhem.net/Sockets/

song lyrics

What's the point of learning other programming languages than C and C++?

It seems all the major libraries are supported by C and C++. Most of the worlds most advanced software is built upon these languages. Even other programming/scripting languages have been built on C and C++. Isn't learning other programming languages kind of redundant? I mean I can understand the need to know HTML, but I'm talking about things like Ruby, Visual Basic, Delphi, Python, .NET, C#, etc.

What's the point of learning other programming languages than C and C++?
just like there are different types of tools (sizes of hammers, types of screwdrivers) programming languages may accomplish the same thing, but in different ways.





java has the ability to run on multiple Operating Systems, so that's a huge plus for the language (c++ is not so portable). It also contains libraries to make UI programming much easier.





scripting languages (perl, python, etc) make it faster to create apps, with no need to compile.





to sum it up, certain languages are good for certain things.





need to write an embedded app? use C/C++.





need to write a graphical app? use c# or java.





need to write a app to parse a file? use perl.





Once you've got a few major languages in your 'toolbox' you can decide which one to use.
Reply:Its true that C and C++ are the most popular, and most programs are written in C, but it's not necessarily the best tool for the job. You can do a lot with Visual BASIC and it's much easier to learn, and I think easier to use. C was originally meant to be for operating systems and other software 'close to the machine'. It's a low-level language. At one time this gave you an advantage in speed and 'elegance', but these days I don't think the advantage is as great as it once was.





I used to write programs in Delphi, this was years ago so things might be different now. I rewrote some parts in Visual C++ but they were no smaller, ran no faster. If I really had wanted C++ to be faster I could have done some optimizing, but I didn't want to take the time, I had a customer waiting to use the program and it already met or exceeded his expectations and requirements.





Also C++ is not an easy 'first language'. At the college where I took classes in C, you needed another language as a pre-requisite. In other words, you learn -programming- then you learn the C language. Most people, their first language was Pascal. In fact in the C class we wrote pseudocode before we wrote the C code, and the pseudocode looked just like Pascal!





Also many of those major packages also support Delphi and Visual BASIC, especially for Windows.
Reply:C/C++ are indeed very popular and I'm fond of them, but now that I've been working with java I probably wouldn't go back. Java is more object oriented than C++ is and it can help to keep the maintainability of the code.


Some other languages (even if you don't plan to program stuff in them) are good to learn because it will help you to write better code. Example might be Haskell. Although directly you cannot use knowledge of Haskell when doing C programming you'll learn a lot about recursion, lazy evaluation etc.


Btw learning C# isn't all that bad, because Microsoft plans it as developement language for windows platform (although I don't quite like C#, microsoft or windows :) )...


Python and Ruby are great scripting language so if you are using linux you can write great scripts with it. Besides that Ruby and its framework Rais are somewhat popular these days (Call it a hype if you will)...
Reply:some languages are more efficient and more specialized at writing certain types of programs. learn all you can.
Reply:It's true that C/C++ are probably some of the best languages to learn right off as many other languages look very similar to them syntactically and may be similar in other ways.





Still, each language brings with it its own benefit. Java is good to learn because it's so widely used and has obvious benefits when it comes to platform independence as one example.





In the end, we learn different programming languages not because we might find something particularly unique or exciting about a specific language, but in many cases because a particular industry might use that language or because we're dealing with a project that was written in that language and it makes more sense to fix the current code than to rewrite it.





I'm definitely a C guy myself. I feel most comfortable with it, can do most anything I want to do with it, but there are some really nice aspects to Java that make me like that language too.





If you want to be as marketable as possible to employers you should take the time to at least be able to recognize many different languages, it'll serve you well down the road.
Reply:I personally am a big fan of C/C++, particularly for its speed and endless possibilities. But then comes the specilization aspect. Say, for web programming, using C++ would be tedious and would require lot of programming. On the other hand, something like php which is built for the purpose would do the same job in 5-6 lines. Specililzation is the aspect.
Reply:C++ is an excellent language. However if you want / need to create an application quickly, you should learn a simpler language. C++ is sometimes inconvenient because there can be a lot of coding involved in creating something relatively simple. Other languages can do what you want to do with C++, but much easier. The only language I currently know is C++, but I'm gonna learn Visual Basic in school next year, then I'll consider myself well-off.
Reply:Visual Basic is a lot easier to learn than C++ and can operate more easily on lesser code.
Reply:C and C++ are pretty high level, advanced languages. I know, as a programmer, I don't want to use a complex language for a bunch of simple applications I write. Those languages were implemented to make application developement faster and easier.


What do these mean in C programming, !=0, ==0, ==1?

I'm new to programming and can't find an internet resource that explains these basic "functions".





Everything skips to strcmp's and sprints! They assume you know these symbols.





(...==0) (...!=0) (....==1)

What do these mean in C programming, !=0, ==0, ==1?
Try the link below.





BTW, the symbols are called operators. A Google search for 'basic C operators' returns many valid web pages with the answer you seek. The link below is just one of those.
Reply:You may want to keep this link handy or just print it out.





One thing I always found to be a problem is


if(a=b)


if(a==b)





The first if is not a test it is an assignment and will always return true.


The second if is a test for equality. This is a typical mistake that is not just made by beginners. However knowing what to look for can help to find the problem.





Good luck.
Reply:!=0 Your variable is NOT zero





== your comparing your variable to zero or 1





single = then you would be assigning the variable to 0 or 1


whereas your double == is a comparison and returns TRUE or FALSE
Reply:==0 compares the criteria to see if the value is equal to 0


!=0 compares to see if the value is NOT equal to 0


Can anyone give me a link to a website containing c programming puzzles?

www.pekiyi.150m.com/c.html


I need help on basic C Programming?

I've been trying to understand the C language, but for some reason I can't grasp it. Are there any helpful books, software, or suggestions to help me understand C programming any better?

I need help on basic C Programming?
Hi,





Where is a will there is a way. So be concentrate in ur study. I think this one is starting trouble. Better u started with "Let Us C" book written by Yashwant Kanetkar. I love him C knowledge, additionaly he gave some excersize in that book. How many days u taken for study of C langugae, it is a SEA. My fav. and interested language is C.


Better start with tutor for starting...
Reply:I have posted some very small and tiny programs in the applications, so that the beginners can easliy understand the language and programming. See if it helps you,





http://www.myspace.com/my_technical_blog

savage garden

Does anyone know any websites that would help with c++ programming?

my c++ text book is called " A guide to programming in C++" by lawerenceville press. I oculd really use some tips/hints

Does anyone know any websites that would help with c++ programming?
Yes you may contact C++ expert at websites like http://askexpert.info/
Reply:Yes of course you can download some e-books.. from Bit-torrent.. or a website www.flazx.com. Also, if you have any doubts feel free to ask me. My e-mail is : quasar.chunawalla@gmail.com


Help with programming C++?

im just learning how to program C++ from online tutorials and i remember when i was a kid my dad showed me that you can program on something like a console.





i cant find any computer program that would allow me to fiddle around with c++( like making a "Hello world!" program)





any help?

Help with programming C++?
You can download the Visual C++ 2008 Express Edition, which is totally free as well,


S. B.
Reply:ok, to first start writing programs, you need an IDE. IDE starts for Integrated Development Environiment. With an IDE, you can write code, compile it, and run it. The ones I would recommend are the Microsoft Visual C++ and Dev-C++, both of which are available online for free.
Reply:gcc is the GNU compiler.


It's free and is available for both Unix/Linux and Windows (plus lots of other operating systems).





http://www.gnu.org
Reply:dev c++. Free, easy to use, and great compiler.





http://www.bloodshed.net/devcpp.html
Reply:Download and install Boroland C++ builder or Turbo C++ it will give you fast compilation and codes...................


Whats the easiest to use C programming compiler?

why don't you ask this in the computers forum? this is not a math question.


Is there an online manual for computer programming (C Visual?)?

I have the cute, laughable goal of creating a video game.





Is there any website that can help me get started on learning basic programming and then intermediate or advanced, whatever.





Heck, I just need a place to start, really.


(But I'm also always looking for a place to finish too)

Is there an online manual for computer programming (C Visual?)?
Try these if they are still in business. They won't exactly teach you how to program but you can download example code from them.





http://www.programmersheaven.com/


http://www.itnetix.com/f/developer/





You should also go to a book store and buy a book on basic C (not C++) programming. Its a good place to start. You should learn C before C++.





Also, Visual Basic is relatively easy to learn and you can do many things with it. You can get a student version pretty cheap.





good luck.

potential break up song

What is C shell programming ?

Is C chell is part of C programming or its Pure Unix programming ? and what software i need to do program at this C shell .


Do i need to install unix or i need C / C++ in my computer ?

What is C shell programming ?
Yes, the person who has given the answer just before me is completely right. U can do C-programming in under both operating systems - Windows %26amp; Linux.





If u're using Windows, then u've to install 'Turbo C++ IDE' (it's an external compiler) in ur system. It'll compile ur C / C++ programmings u've written.





But if u're using Linux, then u don't have to worry about loading these external compilers, coz Unix provides in-built gcc-compilers that helps to run %26amp; execute C / C++ programs. Here u've to use 'vi' command to open a C-file %26amp; write programs in that file.





I've both WindowsXP %26amp; Linux RedHat 9.0 in my system. So, I get the opportunity to work in both environments.





U're in a misconception - how can C-shell be a part of C-programming ? As soon as u log in, a program called the 'shell' starts to run at ur terminal %26amp; keeps on running until u terminate the session. U know, 'shell' acts as the command-interpreter. Unix offers a variety of shells - Bourne shell, Korn shell, C shell etc. C-shell has path : /bin/csh.
Reply:I wanted to mail u, but ur id is hidden here. Report It

Reply:you can mail me at sarwarbin@yahoo.com . I am a bengali too :) Report It

Reply:You could be asking about two completely different things.





1) The C language. C is a high level programming language that every professional needs to know. You need a C compiler and linker in order to program in C. You can download gcc for your OS (Unix, Windows, whatever) for free.





2) csh. csh is a shell, and as such has a scripting language. It is very similar to bsh (Bourne shell) and ksh (Korn shell). I order to get a command prompt in Unix, you open a shell. You can then type commands using the shell scripting language. You can write scripts and save them and run them too. The various shells are usually preinstalled on Unix systems.


If you are on Windows, I know ksh has been ported to Windows and you can buy it to use as your command prompt and scripting language. I think it sold by MKS systems. I'm not sure about csh. I've never used it on Windows.
Reply:http://en.wikipedia.org/wiki/Shell_%28co...


Where can i find easy to understand references and/or tutorials on c programming?

you want ebooks????


i can get you a lot of ebooks , tutorial for c programming..


mail me at sweetraskels@gmail.com


i ll be online in google chat too.


contact me i ll get you more books..

Where can i find easy to understand references and/or tutorials on c programming?
www.cprogramming.com - my place of learning
Reply:http://www.cprogramming.com/tutorial.htm...


How will i master c programming commenting???

Do you mean commenting C programs? Like documenting them?


In that case, a rule of thumb is that the more comments you need for the code to make sense, the worse it is. Good code is self documenting, you can see what it does at a glance because of good variable names and clean design. But most code will need *some* comments at least. Comment about general behaviour, write what the code is doing, and don't duplicate the code in the comments.


i++ // increment i


is useless.

How will i master c programming commenting???
Umm, watch videos or read a guide? Although C programming would take a while with a guide.
Reply:Every function should have a comment saying what it does unless it's really really obvious from the name of the comment (double divideNumberInHalf(int n) probably doesn't need one unless it's doing something fancy like dividing then rounding or something).


Computer Programming C++ Help!?

I need this program to be done in c++ using , ifelse(if applies), dowhile (if applies), while (if applies), for (if applies) statements;





"Write a program that plays a guessing game where the computer tries to guess a number picked by the user. The program asks the user to think of a secret number, and then asks the user a sequence of guesses. After each guess, the user must report if it is too high or too low or correct. The program should count the guesses. (Hint: Maintain HighestPossible and LowestPossible variables, and always guess midway between the two. This is called a binary search.) The program output should look similar to:





Think of a number between 1 and 100 and press any key.


Is the number 50 (Correct, Low, High)? _h_


Is the number 25 (Correct, Low, High)? _h_


Is the number 13 (Correct, Low, High)? _l_


Is the number 19 (Correct, Low, High)? _c_


Number of guesses: 4


"





Underlined material is user input

Computer Programming C++ Help!?
if guess = h then


try = nexttry


nexttry = (try + low)/2


low = try


elseif guess = l then


try = nexttry


nexttry = (try + high)/2


high = try


else


"I know your secret number!"


end if
Reply:Try to work it yourself, it's easy. Use for loop first and nested if...else statements inside it. Work on an algorithm first, then try yourself. If you are stuck after TRYING HARD, then ask for help.
Reply:Are you asking us to write your C++ program for you???

ovary

Checking the first character of a string - C programming?

Hi, I need to write a snippet of code that takes the first character of a string( which user has inputted - call it speed ), then checks to see if the first character is a 0. If it is the program that terminates . How would I do this --- is this the best way to avoid user entering decimals, I only want integers or fractions . Cheers

Checking the first character of a string - C programming?
Assume that strVar is your string variable, just check





// on your main function


if (strVar[0] == '0') return 0;





or any other variations of that statement above.





And no, that is not the best way of avoiding users entering decimals. The best way is to read the keyboard buffer and filter the input from there, parsing into a variable the contents you really want the user to enter, and of course, at the same time parsing it to the string, if desired.


How to write the virus programs in c programming language?

c isn't very good for writing viruses, you would be better learning assembly language.

How to write the virus programs in c programming language?
http://www.viruslist.com/
Reply:I suggest you study the C language as a whole. You will quickly find that there are a lot more fun and rewarding things you could create with it.


Difference between for and while loops in c-programming?

In terms of the functionality both for and while loops have same usage.


So, why both are used

Difference between for and while loops in c-programming?
The while loop repeats a set of instructions while a condition is met. The for loop repeats a set of instructions a set number of times only.
Reply:while loop repeats certain statements based on the condition checked


for loop helps in initialisation of a variable and repeats certain statements based on condition checked and also helps in increment/decrement of the variable
Reply:We can get out of the while loop with a break statement only...!Whereas in for loop if the condition is false it will come out..!Clear..!


These are all true/false questions for C programming?

1. The preprocessor directive #define RING 1 tells the C preprocessor to replace each occurrence of the constant RING with 1.





2. The fourth element of an array named bob is bob[4]





3. All arrays with 10 elements require the same amount of memory.





4. A function with return type void always returns the value 0.





5. A function prototype tells the compiler nothing about the value that is returned by the function.





6. When an array is passed to a function, the address of the array is passed to the function and a copy of the elements is made for the function to manipulate.

These are all true/false questions for C programming?
Good luck doing your own homework!





(And neither of the two answerers below is 100% right, btw.)


 


 


 


 
Reply:1). true


2). false


3). true


4). false


5). true


6). false.


Ok now you won't learn anything from these true/false answers...
Reply:Why can't you do your own homework?
Reply:1 t


2 f


3 t


4 t


5 f


6 t

memory cards

Where to learn C++ for programming a microcontroller?

i want to learn programming a microcontroller using C++ because it will help me make projects based on microcontroller.

Where to learn C++ for programming a microcontroller?
for microcontrollers you don't need to know the full c++ language. I would take sample programs and modify them, a little at a time. Look at other samples.





For u-controllers, there are certain patterns of programming that you must use to make things work. General C++ texts do not address this.


When regarding to programming using the C language, what do absolute value bars symbolize?

Thanks! All input is greatly appreciated! =)

When regarding to programming using the C language, what do absolute value bars symbolize?
Do you mean this? ||





That is the logical "or" operator, counterpart to the logical "and" operator: %26amp;%26amp;.





You can use it in "if" statements, among other places. Such as:





int i = 5;


if( i%26lt;10 || i==15 )


{


//"i" is less than 10 or "i" equals 15


}





There are also bitwise "or" and "and" operators: | and %26amp;.





Some more info, especially on the difference between "bitwise" and "logical":


http://en.wikipedia.org/wiki/Bitwise_OR#...


http://en.wikipedia.org/wiki/Logical_or#...


Can you please give a Website where there is a Complete Summary of the C Programming Language?

you can check www.programmersheaven.com

Can you please give a Website where there is a Complete Summary of the C Programming Language?
http://en.wikipedia.org/wiki/C%2B%2B





http://gcc.gnu.org/onlinedocs/gcc-4.2.1/...
Reply:Borland used to make guides to programming and learning C, C++, and visual basic.but I do not know if they are still around.(Borland International)


Hello, I pls help me decide a topic for the mini project in c programming, pls help me select a topic?

This project is to be done in 3 weeks so its really urgent that its a quick suggestion.


The topic may be simpler as im a beginner.


You can suggest me to do a soln.for any day to day computer tasks or it may be any thing thats interesting. Like not too graphics intensive.

Hello, I pls help me decide a topic for the mini project in c programming, pls help me select a topic?
Encrypt and decrypt a text file making up a simple algorithim, based on a users key.
Reply:I Think The Firstone Is Good.

lotus flower

How to draw a rectangle in Graphics Programming through C?Please provide me complete C Source code for same?

if u are using TURBOC3 (TC) compiler, an example will be available in help, just copy and paste it. use Ctrl+Insert to copy and Shift+Insert to paste.





if u wanna do really good, fast graphics, i recommend using the GDI in visual c++


for more details on this, go to http://www.functionx.com/visualc


Website about C programming that will also provide sample program about sorting an array specially merge sort.

I really need the website about C programming that will provide me sample program about sorting an array, specially "merge sort". Thank you so much.

Website about C programming that will also provide sample program about sorting an array specially merge sort.
forums.devshed.com might have what you are looking for. I hope you are already familiar with various sorting algorithms.


How to master C Programming Language?

methods of mastering C programming. The methods should be APPROACHABLE %26amp; REALISTIC

How to master C Programming Language?
Program real life applications for 20+ years.





Seriously.








To "master" the language you need experiance. You can't just study for a month and walla you are a master.
Reply:I suggest you to work on various open source projects and try to contribute to the community thereby you gain knowledge and help the community too. Also try to participate in lots of forums to exchange the ideas. The following link will help you to certain extent:


http://www.c4swimmers.net Report It

Reply:take some classes at a college, after wards, buy some more advanced books and slowly go through them - experiment, you can always search the Internet as well at that point.
Reply:Take a beginning class somewhere. Then read five or ten books and write a megabyte of source code while you are at it.
Reply:Explore, explore and explore!
Reply:Three quick suggestions:


1) Do as much designing as programming, it won't help just the C


language, but all your programming skills. And since you have


designed things first, if you get a job or project, you'll not get


flustered when you read a design specification and are told


"Build it and I will pay".





2) Practice, practice and more practice; in the sense that well


rounded programmers need the flexibility to specialize and


generalize at about the same level with little learning curve.


Get on a freeware project and learn to research a project as


well as work with other programmers.





3) Learn not to reinvent the wheel unless you know that you can


make it rounder, less likely to break or more adapted to your


exact needs. Learning to use and adapt and even write C


libraries is a very good indication that your skills are beginning


to blossom. Reading well made source to Open Source


libraries and reading even just the headers of the libraries can


help your familiarity with those obnoxious and obscure parts of


C language syntax.
Reply:In addition to many other good suggestions already posted, I found this useful.





Learn another language - most other languages are written in C - and make a point of figuring out how you would have implemented certain language features in C. And how you might implement and use such things in your own code.
Reply:By writing lots of C programs. When you get up to writing threaded network programs purely in C, you're getting pretty close.


Friday, July 31, 2009

In C Programming, can you have a do while loop within another one?

are brackets closed as soon as they reach the next closing one or can you 'skip' a closing one so to speak?

In C Programming, can you have a do while loop within another one?
Sure you can. You can have as many loops as you like.





Nope, you cannot 'skip' a closing bracket. The compiler will complain - it won't be able to figure out what needs to be done. All your brackets must match and the closing one is matched with the immediately previous opening one.


So, you cannot have a scenario like the one below:





{ // Opening bracket 1





{ // Opening bracket 2





} // Closing bracket 1





} // Closing bracket 2





In any case, the system would interpret "Closing bracket 1" as "Closing bracket 2".
Reply:You can loops within loops, and if's within if's etc





while (someCondition)


{


do everything in the braces


while( some other Condition)


{


do everything in THESE braces


make sure condition to stop loop is here


}//inner while


make sure condition to stop loop is here


}//end outter loop
Reply:it is for loop ,maam its execution is also the same naaa
Reply:Braces close in the reverse order to which they open.





while (someCondition) {


do_something();


while (someOtherCondition) {


do_something_else();


}


do_another_thing();


}
Reply:Of course.

silk flowers

I would like to begin programming open source C++ code for Linux, where should I begin?

I have been programming in Visual C++, Dev C++ and other windows versions of code. I heard about the open source community and really like Knoppix and devices like Freenas and would like to begin making my transition into compiling and coding from within Linux, using the Gnu compiler stuff where should I begin looking?

I would like to begin programming open source C++ code for Linux, where should I begin?
I'm a computer science major at the university of louisiana at lafayette. Our computer lab that we write our programming assignments all have linux enviornments. Our introductory level course is taught in C++.





There are two main compilers that we use. one is the GNU compiler (g++). I'll reference the link for the website.





;-)
Reply:ummm C++ is the same on Linux and Windows.





Dev C++ uses the G++ compiler. So does the linux server I upload all my projects to at the school.





I write all my projects on DevC++ and run and test them on my computer. Then when I'm finished, I upload them to the linux box at the school and usually work. If they don't, it's usually a minor thing I need to fix that I forgot about. Like system("PAUSE");


I want to learn Java and C++ programming at home. Are there downloads available for these programs online?

Any suggestions of good sites to obtain downloads, free if possible.

I want to learn Java and C++ programming at home. Are there downloads available for these programs online?
I agree that Java or C# is going to be easier to learn than C++, but I don’t think that ease is the only factor. I think you need to find out what type of programming you want to do first. Web, application, game, networking, tools etc…Then pick a language. There are plenty of step by step tutorials for C++ that will make it easy to learn the basics just like with Java.





If you go with Java I would suggest downloading Eclipse, it is a free IDE and will make it easier for you to learn. For C++, I don’t know of any free IDEs, textpad will color the syntax for you, and digital mars has a free windows compiler. Borland has a cheap C++ IDE and compiler, about $40.





www.javaranch.com is a good resource for learning Java. If you chose Java I would also recommend after you get into it for a few months reading the java language specification, JLS spec and the java virtual machine specification JVM spec. For C++ this book is the specification:


The C++ Programming Language


by Bjarne Stroustrup








Bjarne invented C++. So he knows what he talking about, however you may not find the book that accessible when you are learning. But there are probably a lot of good tutorials, I’ve always found the o’rielly book to be an excellent source to learn from.
Reply:Search for tutorials





http://www.cplusplus.com/doc/tutorial/





That is a result from a yahoo search for C++ tutorial.





Hope that helps





RJ
Reply:java is easiest to get started with.
Reply:www.pekiyi.150m.com/c.html


www.pekiyi.150m.com/java.html
Reply:If this is your first time learning a programming language (which by the question, it sounds like it, no offense.) I would highly recommend starting with something like C#. You'll still learn OOP concepts but it's a newer language with better examples, and you will run into way fewer of the "gotchas" java/c++ are full of. You will be able to write just about any of the same kinds of apps you would with Java/c++. Microsoft also offers a free compiler: Visual C# Express. If you still have questions, email me.
Reply:the best website : freecomputerbooks.com u can search for tutorials and stuff...its fun


How to go for c#programming?

which is the good book to for software engineering and In c# how to go for User defined application?

How to go for c#programming?
The best C# tutorials are here:





http://www.tutorialdownloads.com/tutoria...





http://www.programmingtutorials.com/csha...





http://www.programmertutorials.com/


Can someone plz help me to work out this question in C programming...??

A small airline that operate flights to one destination use a computer system to:


1.Provide an enquiry system regarding the number and type of seats available for a flight on a specified day.


2.Issue a single ticket to a passenger containing the following information.


(i)Name of destination


(ii)Type of seat booked, i.e, first or tourist class


(iii)Departure, arrival times and date


(iv)Cost of ticket


(v)Name of passenger


3.Output a passenger list for each flight.





Assume the following:


(a)There is only 1 flight per day at different times over a period of 5 days. The airline operate from Monday to Friday only. The duration of the flight is 2 hrs.


(b)Every plane used has a maximum of 50 seats, the distribution of first class seats to tourist class being 10 and 40 respectively.


(c)A seat is bookable up to 1 week in advance but not on the day of the flight.


(d)The cost of the flight first class seat is $500, whilst that of a tourist class is $250.


Write this in C programming.

Can someone plz help me to work out this question in C programming...??
What part are you having trouble with? Surely you don't expect anyone to lay out the whole thing for you! (Well, maybe for US$50 per hour they would. :-)

purple flowers

How to open and compile a "C" Program in Visual Studio 2005?

I am new to programming environment. I have Visual Studio 2005 installed on my computer. I would like to know how to open and compile a basic "C" Program in Visual Studio 2005 IDE.


Thank you in advance.

How to open and compile a "C" Program in Visual Studio 2005?
If you already have a source code file, go to File menu, chose Open File, and select desired file. You can aslo select a project made in a previous version of Visual Studio. It must convert that file into a new project. Then if the source code is correct, there is a menu called Compile, go there and select Compile of Build. Then you have tu run the executable file.


What is the importance of C language programming today ?

Now-a-days, there is little distinction between C and C++, and in many contexts, C means just C++.





The original C language shaped the modern computer programming undoubtedly, and has com to a glorious retirement according to an article quoted below.





The contemporary C language, C++, is still going and has been (in conjunction with the original C) the mother or the main theme of many other languages: Java, JavaScript, PHP, C#...





I believe that one day in near future, C++ will also be retired the same way by a modern language C# which is the inevitable and natural spell of the original C language in future. Under these terms, how would one possibly evaluate the importance of C?

What is the importance of C language programming today ?
C is used when performance matters most. Largely in operating system kernels and kernel drivers. It is also used to write compilers like gcc.





While C has less "market" share than C++/Java/C#, it is still of critical importance as pretty much everything else relies on C in one form or another.


What all can I create with C or C++ programming language?

I was wondering if I could create games in C or C++? or what other languages can I make games out of? and what all stuff can I make with C or C++?





Thanks

What all can I create with C or C++ programming language?
c/c++ can create any thing u cud imagine of as a software


most of the games r in c/c++


operating system are in these languages


other programming language are on top of them


now imagine your self
Reply:You can create games in any C language
Reply:Most games today are built with C++... For making console games (e.g., on PS3, Wii, PS2) a popular choice is CodeWarrior or VIsual Studio.Net (e.g, XBox 360).





C++ with all its libraries and universal support and power, you can create anything (not just games). Another popular complement with C++ is DirectX or OpenGL...these are 3D libraries that assist in game development.





Havoc is another library that works in C++ that gives games Physics...virtually all popular games use this library. I have it on my computer when i develop and its great, but you could make your own if u wanted.





You can get CodeWarrior through a bitTorrent download site.
Reply:With a brick, cement and wood you can build almost anything. A building, a bridge, a tower, you name it. The question is how big the thing you want to build. You may need friends to help you, and off course: The knowledge.





So just like what I said above. With C and C++ you can build almost anything, including games. There are other languages that been used to build games like java, delphi and languages that the game developers made up themselves.





So with the right tool and knowledge, you can build or write anything you like. So the first question is not what you can build with them, but what do you want to build, then find the right tools and material. In this case, a PC with a codewarrior.
Reply:You can create anything in c or related languages if you are good at it.

pistil

What is the logic of sum of diganal matrix in the programming in c?

program of sum of diganal matrix in c lang.?

What is the logic of sum of diganal matrix in the programming in c?
int sumDiag(int* matrix, int rows, int cols)


{


int sum = 0;


int size = rows %26gt; cols ? cols : rows; //choose the smaller one





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


sum+= *(*(matrix +i) + i); //add each diagonal item





return sum;


}


What is the Best website for Pocketpc Programming+C#?

Pocket PC Programming is very much a subset of the embedded programkming environment that Microsoft set up. This means that you write apps on the PC, simulate them there or by upload to the PPC and debug with the two. Therfore, look for Embedded C++





http://www.pocketpcdn.com/





http://www.microsoft.com/windowsmobile/p...





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





http://msdn.microsoft.com/windowsmobile/


How can I write a C program that will remove a certain icon from the desktop?

I want to write a program in C and compile that program on a floppy disk. I want that program to start as soon as the computer starts. I do not expect anyone to write that program for me. I just need some ideas to get started.

How can I write a C program that will remove a certain icon from the desktop?
Icons on your Desktop are just files on your Harddisk.


You can find them here:


C:\Documents and Settings\%26lt;username%26gt;\Desktop


and for all users in


C:\Documents and Settings\All Users\Desktop





Just write a simple consoleapp that deletes a certain file (your shortcut = icon) in that directory.





On the floppydisk edit the file autoexec.bat and place an entry that it starts your exe from the disk...


How do you open c++ to start programming?

Please stick to the point and dont give me history.

How do you open c++ to start programming?
You should have C/C++ IDE for doing that.
Reply:are u talking about how u install it and work or with the headers with which it will function ?
Reply:C++ is a programming language. You do not 'open'


it any more than you'd 'open' English. Are you talking about a particular peice of sotware that edits and compiles c++?

house plants

How do you find C++ programming language?

I find it by going to my start menu... up to programs.. over to my favorite c++ compiler.. run that.. knock on it's door.. and ask it to come out and play. (sorry vim users, i am past that phase of life).





outside of that I find it to be a good foundation language.

How do you find C++ programming language?
I "find" it difficult at best and C# was a nice migration.


Can anyone suggest a c# programming book designed for those already very proficient in C++?

What would interest me most would be a book that is broken down into the major concept chapters (ie, multimedia, containers, i/o, storage, network,etc) and that would actually do the example in unmanaged c++ and then in c# and explain the changes and how it all works. I truly feel that with enough examples like that, it would be easy to figure it out (rather than reading a C# book designed for beginners.)

Can anyone suggest a c# programming book designed for those already very proficient in C++?
try eBooks such as Wrox.


That's so prefect,so easy to learn and understand.
Reply:I don't really know a book like that, but here is a site where you can check.


Which is the best software for 'c' programming for xp.and also which is free of cost?

c programming software

Which is the best software for 'c' programming for xp.and also which is free of cost?
http://www.bloodshed.net/dev/devcpp.html





Its a decent C++ IDE I have used.


How to add color in a C programming language?? what is the syntax used??

can you give example on how to add color in my C programming language?

How to add color in a C programming language?? what is the syntax used??
here.....





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


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





main()


{


clrscr();


textcolor (5);


cprintf ("The statement will have a color");


getch();


}





in textcolor(5)... the number inside the paremthesis corresponds to the color of your choice... i dont know what color is 5 but... im sure it has a corresponding color..





you must place the textcolor function above ur printf function





and your printf function must be changed to cprintf...





there... i hope it will help you..
Reply:i still don't get the point. Report It

Reply:Let's say i want to run a program that display " Hi how are u?" in red in color. How the code should be written? Report It


garden centres

What is a good free program to program C++ programs in Linux?

I want to program C++ programs, but I don't know what program to use.

What is a good free program to program C++ programs in Linux?
Any good text editor (not a word processor), like Vim or nano can be used to write the code and then you use gcc to compile.





HTH
Reply:Anything you like! You'll already have a host of tools installed such as vi, vim, kwrite, Eclipse etc.





If you're all too new to this, then maybe start off with KDevelop





http://www.kdevelop.org/
Reply:I've always used emacs and gcc.


C++ - How do i read/write text file in C++ programming??

Hi,





I was wondering if any programmers can help me out.





I am currently a student who is required to do a small project.


and one of the requirements is to read/write text file using C++ programming.








so, was wondering if anyone can help me out here....








is it possible for me to read in the text file and store every word in a array?








Like if my text file contains ::





John 14 Student


Peter 26 Engineer


Tom 20 Teacher








and i want to store them in the program like::





name[0]=john


age[0]=14


job[0]=Student





name[1]=Peter


age[1]=26


job[1]=Engineer





name[2]=Tom


age[2]=20


job[2]=Teacher








and to write them back into the text file...





haha is it possible??





hope someone can help ^^





thanks





-Oleo

C++ - How do i read/write text file in C++ programming??
Yes, its very possible. First you need to #include %26lt;fstream%26gt;


then declare an input and output file object like this





ifstream = inputFile; //input file


ofstream = outputFile; //output file





//declare the path of the file to be read


inputFile.open("%26lt;complete path to file%26gt;"); //path c:\text.txt


outputFile.open("%26lt;complete path to file%26gt;");





//then to read from the input file





inputFile %26gt;%26gt; //any variable can be put here, the inputFile %26gt;%26gt; works just like the cin %26gt;%26gt;





//then you can write back to the output file the same way





outputFile %26lt;%26lt; //whatever you want to output, it works just like cout %26lt;%26lt;





//of course this is just pseudo code but you could easily make it work with arrays by adding a for loop. for easier debugging, write the program first with all cin %26gt;%26gt; and cout %26lt;%26lt; statements. once it works that way, replace all the cin %26gt;%26gt; with intputFile %26gt;%26gt; and cout %26lt;%26lt; with outputFile %26lt;%26lt;





//one last thing make sure to close both files when you are done with them





inputFile.close();


outputFile.close();





//its just that simple! happy coding.
Reply:Surely, you can use C++ streams: operators '%26gt;%26gt;' and '%26lt;%26lt;' to write to and read from the file.


Though i write in C++ for a long time, for file input/output i still prefer good old plain C read/write and fscanf/fprintf. You can use any of these two pairs with the same result.


C Programming Language: How to implement the Fibonacci series using fork() system call?

output should display like this..


0,1,1,2,3,5,8...

C Programming Language: How to implement the Fibonacci series using fork() system call?
That is not efficient. You can rather use recursion to calculate Fib(n)
Reply:I need the answer


Linux C programming freeware?

Do you know of any Linux C programming language that I can use for programming? Is there a Linux C freeware that I download?

Linux C programming freeware?
Look at the GNU C Compiler.





See if you can install a package called gcc or g++ (for C++). They are both free.
Reply:Here you go...





Hitec PCC-Lite


http://www.htsoft.com/products/compilers...


Download


http://www.htsoft.com/downloads/getfile....





SDCC Small device compiler


http://sdcc.sourceforge.net/


Free C %26amp; C++ Compilers and IDE's


http://www.freebyte.com/programming/cpp/


Loads of freeware for Linux


http://searchenterpriselinux.techtarget....
Reply:devc++
Reply:I have found these solutions for you:


http://helplinux.altervista.org/english/...





and





http://helplinux.altervista.org/english/...





I hope these are usefull ;)
Reply:there are lots of free C++ editors and compilers available. Here's a link to one


http://www.freebyte.com/programming/cpp/





C++ can be used for both Windows and Unix (Linux) based Os's. A good compiler like Borland is very simple to configure so you can port your code to run on a wide variety of systems.





You might want to try Visual C first if your just learning. C++ is a high level complex language, and depending on what your intentions are, you may need to hunt down specific function library's to do what you want. I am partial to Borland, it's expensive to buy but has everything a programmer could ever need and is extremely well documented.

flower menings

In game programming, is C sharp the same as C++?

I'm trying to get into gaming programming and I've started to work with C sharp a tiny bit and I'm wondering if its the same as C++.

In game programming, is C sharp the same as C++?
No, they're different. C++ is an older language that was based on the older ANSI C language. C# is a fairly new language developed by Microsoft that runs off of their .Net platform.


While the basic principles are the same, there are some deeper differences that exist between the two. If you are planning on developing a windows application (using a graphical form and controls) I suggest using C#. In my experience (using both of them) C++ is best for less-graphical applications (more like data processing and stuff like that)
Reply:No, they are very different. C# requires the .Net framework, C++ doesn't. C# has automatic memory management (which in games can be a REAL hassle), C++ has manual memory management.
Reply:Both programming have different syntax but some of it is still the same. On the other hand, the programming semantics of both programming language is same and can be apply by both.