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.