Tuesday, July 14, 2009

C Programming Language: How do you truncate?

Whenever I try to run the the code through the complier with trunc(x), I get this error message:





Undefined first referenced


symbol in file


trunc /var/tmp//ccExIysK.o


ld: fatal: Symbol referencing errors. No output written to a.out


collect2: ld returned 1 exit status





and whenever I try to run the code through complier with truncf(x), I get this error message:





Undefined first referenced


symbol in file


truncf /var/tmp//cc3cRAJq.o


ld: fatal: Symbol referencing errors. No output written to a.out


collect2: ld returned 1 exit status





How do you truncate in the C programming language?

C Programming Language: How do you truncate?
make sure that u r using the right header file


write:


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


at the top of ur code

periwinkle

C programming practical books?

give me alist of c programming books

C programming practical books?
"Sam's Teach Yourself C In 24 Hours," Tony Zhang %26amp; John Southmayd.
Reply:yashwant kantekar-practical





balaguruswamy-theory
Reply:If you are in India you can use Kanitkars "Let Us C". This book is good for Starters as well as expert programers. For programing codes you can visit my blog http://codesbyshariq.blogspot.com
Reply:Check out http://www.amazon.com/
Reply:You could be a little more polite about it for starters.





Every C programmer should have or probably has this book it is written by one of the people who created C:








http://en.wikipedia.org/wiki/The_C_Progr...
Reply:balaguruswamy
Reply:Well, Sams "teach yourself in 24 hours" series always seems to work out well.





I personally learned from a book by Deitel:


http://vig.prenhall.com/catalog/academic...





It's designed for courses in programming, so it has a lot of excercises you can try.


Online guide to C or C++ Programming?

what are some good sites for learning C or C++ computer programming.





i am trying to learn how to write programs, but am lost on all these search engines with nothing coming up...help please.

Online guide to C or C++ Programming?
http://www.cprogramming.com/tutorial.htm...


http://www.cyberdiem.com/vin/learn.html
Reply:http://www.cppgameprogramming.com ---%26gt; C++ and Game Programing


http://www.mycplus.com/


http://www.gamedev.net ----%26gt; Game Programming
Reply:If you're doing visual C++, you may find this site helpful.





http://msdn2.microsoft.com/en-us/library...
Reply:Are you sure C or C++ is the best choice for you? There are free interpreted scripting languages which are much better for mastering programming technique, and which have important advanced features like object orientation and so on. Since they are interpreted and not pre-compiled, they can be used interactively which is a great way to explore the language and figure out a rough approach to a problem.





Python is a great example of one of these advanced interpreted scripting languages. You probably already have it on your computer -- type "python" at a terminal prompt. If something happens, Python is installed; type control-D to exit. One great strength of Python is its ability to link to C++ code, which allows you to program fast blocks of code for those (rare) instances where native Python is too slow; you can continue using all the old code that is not causing a performance hit.


Anybody genius in c++ programming .This question is specially to them........?

Describe about c-strings in c++ programming .mention its functions


and also advantages of using these strings while programming....

Anybody genius in c++ programming .This question is specially to them........?
Hope this will help u


http://www.cprogramming.com/tutorial/les...
Reply:What are c-strings?
Reply:You don't need to be a genius to answer that.





Don't be so specific like that - give _everyone_ an opportunity to help you. Otherwise it's called "looking a gift horse in the mouth".





Rawlyn.
Reply:yes indeed


C programming book?

any one knows , where i can get softcopy of Programming in ANSI C - E Balagurusamy

C programming book?
Dennis Ritche, programming in C.


This is best book I have ever seen, for ASCI -C programming.





LetsC is the second option that I'll recommend.
Reply:Balaguruswamy's book is very popular for C learners(beginers) try it out from any Engineering book store. Or read Let us C by Yashwant Kanetkar
Reply:try bookmooch.com I am using it for trading books with people

night blooming cereus

How do I practice C programming at home?

Hi,





I'm taking a basic programming class since I'm an electrical engineering undergrad. I have programming classes every Monday and Wednesday, however, for the type of learner that I am, I need to do a lot of practice. I asked my professor how I could work at home, but instead, he suggested that I just come into the lab to work my problems out. I live pretty far from school so I don't really want to do that. I mean, it's regular C language, so I'm positive I could do it on my laptop running XP media center '05.





I don't know the info you need to answer the question, but here are a few facts.





-We're using the OS Red Hat Linux


-We use text editor to program


-We use something called terminal that looks a lot like MS-DOS





I've read that I can use notepad and MS-DOS to do the same things, but I couldn't figure it out. I hope I gave enough info. I'll add on more if you do need to know some extra.

How do I practice C programming at home?
In linux


vi a.c


write code


type gcc a.c


run a.out


in windows


download turbo c compiler and use it to compile the code.
Reply:The Link below tells you how to write an ANSI C program using C++ in 2005 Visual Studio.
Reply:There will be some differences in the libraries available to a Windows Programmer and a Unix/Linux programmer. For example, Windows does not have a "fork()" function (as far as I know). Unix/Linux does not have a conio.h library.





I would suggest trying an install of Linux on your home computer as a dual boot system. While there are very good C/C++ compilers available for Windows, Unix/Linux is pretty much the standard for techies. If you're going into engineering, you will probably need to learn Unix in one form or another.





Also, Linux and Unix are pretty good about following standards. The Gnu compiler is pretty universal on all Unix like systems, like Linux and Mac OSX.





Any Linux distro will do. For a newbie, try using Ubuntu or Kubuntu. You will need to select development packages during the installation. You can use a fancy IDE like eclipse or Kdevelop. However I personally prefer to use EMACS while some folks I know prefer to use VI. In any case, these editors are geared more for programmers.





The Idea of using Notepad to edit code sounds excruciating. Notepad is not meant for programming. It doesn't have a C mode that automatically indents your code for readability. It doesn't have macros that make programming easier. It is simply a very bare bones editor.





Another option is to download the Cygwin toolkit. Cygwin is a port of the Gnu compiler for Windows and it includes a bunch of standard Unix libraries ported to Windows. It also includes a bash shell (the thing that's like the MSDOS prompt).





Learn the shell. Bash is much more powerful than the DOS shell and if you go into engineering and programming, you'll find it handy to know. I don't know how Windows programmers are able to program without it.





For an editor, I personally recommend EMACS. It has been ported to Windows. But for any really large projects, you'll want an IDE like eclipse.





Whatever you do, do NOT go out and buy Microsoft Visual C++ or C#. They are NOT standard and are not easily ported to Unix (where your schoolwork will be graded). As I said, as an engineer, Unix will probably be a requirement.
Reply:All you need to write C at home is a text editor and a compiler. The text editor can be as simple as notepad or as slick as the Eclipse integrated development environment. For a compiler, google 'c compiler' and you'll get a whole list of freebies.





Something else you might be interested in would be Microsoft's Visual C# (pronounced "C Sharp"). You can download Visual C# Express for free from their website, which will include a compiler and -- in my opinion -- the slickest of all integrated development environments, Microsoft Visual Studios 2008. From there, you can build Windows applications, web applications, XAML browser applications, web services -- all kinds of stuff.





Best of luck.








Edit -- to "Mike D"...





I find it hilarious that a professional programmer -- who uses EMACS, no less --can't figure out know how a Windows programmer can function without BAsh .





See, to me, one look at BAsh and emacs makes me have flashbacks from when I was programming Pascal on Unisys ICON machines in a QNX environment back in high school... Kinda makes me want to put a gun in my mouth, frankly.





I mean, say what you will about Microsoft, but Visual Studio sets the gold standard for integrated development. Open your mind, give it a tumble, and see what it's like writing code in the 21st century. You might just like it.


In c programming using fibonacci sequence, if n=2 and sequence=5, can you display "2 2 4 6 10" using C code?

C programming only pls.

In c programming using fibonacci sequence, if n=2 and sequence=5, can you display "2 2 4 6 10" using C code?
google it, something like:





fib(n){if(n==1||n==o)return 1;else fib(n-1)+fib(n-2);}





Hope that helps


Visual C++ Programming?

I need to create a .exe file that will end all processes when run, supposed to work on all windows versions. My friends said use Visual C++ programming? How to do? If you can helpme create please send to J_C_Senior@hotmail.com . Thanks.

Visual C++ Programming?
What did your teacher say to use? That's an odd assignment.
Reply:you can't kill all processes unless you're a Ring 0 application, which means that you have to write your own windows driver.





as an application, if you have administrator rights, you can kill most applications, not all.





if you don't have administrator rights, you can only kill those processes which belong to your user.





i'd suggest you search codeguru.com for code, they have a lot about windows programming.


Is C++ programming a career?

I've taken an interest in C++ and such computer related things. But I want to know if it is something that can be a career that pays well or simply something like a side hobby.





How long does it take to "master" C++ programming and is it something anyone can do just by reading books or is it complicated like becoming a doctor or scientist or something like that?








(And thank you for the many short, stupid answers I will receive out of a few good responses)

Is C++ programming a career?
Can be. I started with basic. Do you know how old that is? Last one I liked was Turbo Pascal. Not near as in depth as c++. It is very similiar to c. If you can do Pascal you should take on c++. These days C++ is where its at. It is very robust. I believe a lot of programs are based on it. These days with computers evolving and programs getting larger it will be an ongoing learning and relearning task. So would it be a career? I think so. Lastly I was told C++ is a hackers dream. Web page design is a money maker. Too many people in networking. Hope this helps.

orchid cactus

What should I do to practice C# programming?

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





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





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





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

What should I do to practice C# programming?
purchase complete reference book of c# and read it. and also we will get lots of tutorials for c#.read and practice.
Reply:b practice with MS .net 2005 edition





find tutorial on google .com by writing a key word





C# Tuitorial





www.devasp.com


www.progrmmersheaven.com


www.codeasp.com


www.projectcode.com





find c# code there





rest feel free to contact





ali.shakeel.mir@gmail.com
Reply:Plenty of stuff on the web that can help you and its free too.


Here's a few:





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


http://www.csharpfriends.com/


http://www.csharphelp.com/


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


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


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.


Linux c++ programming?

I have fedora 8 and i was wondering what compiler and programming environment should i use if i want to program with C++. Thank you. i love linux by the way

Linux c++ programming?
install G++ that is GCC's C++ compiler
Reply:I love Linux and computers but I just changed my major from computer science 'cuz I couldn't take the super long hours of inactivity. I personally like Emacs and there was another i used called Kate which was friggin' awesome but i didn't use it long enough to figure out all the tricks it had to offer.
Reply:g++, the GNU c++ compiler, is most likely already installed.





There are many IDEs/editors available. I use vi and gdb. KDevelop is a KDE IDE which is similar to microsoft visual studio. you can also use eclipse.
Reply:gcc is the standard complier used for just about everything.





You can code in any text editor you like. Try them all, see what you like.
Reply:Use the GNU C++ compiler. It can be used by the command g++.





I suggest





$ g++ -g -o outputfile.exe inputfile.cpp





If your looking for a good c++ IDE I would suggest eclipse or VGUI. Both are good developer Environments.


Write a c++ program using Object Oriented Programming?

write a c++ program using Object Oriented Programming


to accept Customer Code No , Customer Name and Total Bill Amount


of (n) number of customer


n is accepted at runtime











Also after accepting print the data as per format given below





Customer





Code No Name Total Bill Amount


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














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


Grand Total





Print the Grand total in word format as





If Grand total is 8769


Print as EIGHT SEVEN SIX NINE





Member Function prototype is





char * wordnum ( int ) ;

Write a c++ program using Object Oriented Programming?
Wow.. I tell you something that it's going to be a big program, and it won't be feasible to get it all up here!


Let's start then! First you have to create a link list, or if you want, you can declare an array, and ask for the number of customers. The array that you will declare should be a class object which will have all the required fields, as customer number, name, etc. Then, you input the values, and output them. If this works fine, go ahead and do the rest, which will be a lot easier to implement.


I hope I gave you a good starting point.


Good Luck!

palm

Give me C a programming project?

Ive been studying c programming for about half a year in college now yet the only project i have done is program a calculator in C. I was wondering if anyone could give a few simple ideas of a project to do.just something small and not much harder than a calculator? any ideas?

Give me C a programming project?
Hello,





Following are the ideas that I can share with you:





1. Library management system where you store records in a file... this will be very challenging and will help you improve your logic





2. A small screen saver type of a program where you clear the screen allow the user to type in his name and then you bounce his/her name on the screen... much like a ball on the screen.





Hope this helps.





Regards,


Sunil


http://www.careercurry.com
Reply:lan chat software


games
Reply:Most of the people ask for this thing here. Just search for this question on Yahoo answers and you will get many similar questions and many answers too....





Have a look here.


http://in.answers.yahoo.com/question/ind...


In C programming...?

how do i delete a character in a textfile using c?, if for example i have a text file containing these text:


"programming fundamentals", and i want to delete 'fundamentals', how do i code that?

In C programming...?
I imagine you would go to a certain buffer location(seekp) and replace the strings with space by writing to the file(fstream.write()). Another method would be to read the file into memory, do the replacement and overwrite the whole file.


Where is c++ programming used and who uses c++ programming?

what collages offer c++ programming

Where is c++ programming used and who uses c++ programming?
C++ was the most popular choices in any kind of client programs in the late 80ties and 90ties. There des therefore exist a hughe amoutn of existing software that is written in C++. The inventor of C++ created a list of some of them here:





http://www.research.att.com/~bs/applicat...








Today, C++ is constantly loosing market share to other languages (mostly C, Java and .NET based languages), but it is still one of the


most popular languages for many tasks such as rich client side applications.
Reply:It is used in software, and all Computer Engineering and Computer Science programs should teach it.


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++.

petunia

Best programming certification in C++ for finance ?

I have already a master of Science in Mathematics and in science computer , but I didn't learn advanced C++ programming. I have only learnt Java. I wish to work in the financial industry and I would like to know 2 or 3 of the best professionnal certification in C++ programming, valuable for a carreer in financial sector.

Best programming certification in C++ for finance ?
You should be learning about the business. Your degrees are great and you have enough technical credentials to get an IT job in a financial services firm. But if you could also impress an employer with business knowledge, that would put you over the top. Passing a Series 7 or 63 exam, getting a CFP designation or classes about brokerage and banking will all help tremendously.
Reply:Certification bootcamp- http://mcsdelearning.info/





microsoft certification tutorials


at


http://mcse-mcsd.blogspot.com/


C programming problem?

write a program that takes a line at a time and reverses the words of the lines.





ex. input: i am confused


output: confused am i





the data should contain one blank between each word.





any idea on how to solve this problem?


please give some ideas... how to solve this in c programming language...?

C programming problem?
ur program is bit difficult and is not so easy as it seems. what u got as first answer is incorrect since it will print only reverse charcater of ur answer. i.e. this is me gives em si siht which is not what u wanted. i have tried to write a program but the program has some bug and it is not giving what i wanted. i have done the following


1. count the no of blank spaces in string. this will give u the number of words in sentece say no_blank.


2. then create a array that stores the location of blank spaces in the sentence int array[].


3. using that array u then copy the word between two blank spaces from back.





// !! RAM !!





#include"stdio.h"


#include"string.h"


char* returnreverse( char a[] )


{


int no=1;


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


{


if( a[i] == ' ')


no++;


}


char *words = new char [no];


int r=0;


for( int j=0;j%26lt;strlen(a);j++)


{





if( a[j] == ' ' )


{


words[r] = j;


r++;


}


}


words[r]= strlen(a-1);





char *rev= new char[strlen(


a)];


int m=0;


for( int h=r;h%26gt;= 0;h--)


{





// copy the words from a[words[h-1] ] to a[words[h-1]] in rev


for(int s= words[h-1];s%26lt;words[h];s++)


{


rev[m] = a[s];


m++;


}


rev[m]=' ';


m++;


}


return rev;


}








main()


{


char s[100];


printf("\n\n\tEnter a string : ");


gets(s);


printf("ur reverse string is");


printf( returnreverse(s) );


printf("\n");


return 0;


}


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


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


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











int main() {





char s[1000];


int i;


int len=0;





while (1) {





printf("\n\n\tEnter a string : ");


gets(s);





printf("\n");





for(i=0;s[i];i++) {


printf("%c",s[i]);


}


len=strlen(s);


printf("\n\n");


for(i=len-1; s[i], i%26gt;=0; i--)


printf("%c",s[i]);


}


return 0;


}
Reply:first you should save every particular character of that string in another array meaning you have to declare a new array and put the first character in the last index and so on.... you should use some string methods to be able to get the length of the string. I remembered that It might be "string.length" or something like that.


C programming problem?

write a program that takes a line at a time and reverses the words of the lines.





ex. input: i am confused


output: confused am i








ex.2 input: she is beautiful


output: beautiful is she


the data should contain one blank between each word.





any idea on how to solve this problem?


please give some ideas... how to solve this in c programming language...?

C programming problem?
Once you have the sentence as a string, you could use sscanf() to read each word. A space in the format string will skip whitespace, and I recall that you could use a scanset, if necessary. However, if you can use gets(), then go right ahead.





As for reversing the word order, the most elegant way is to use a stack. However, rather than implement your own stack, I suggest using the function call stack, in conjunction with recursion.





Now, I'm not going to do your assignment for you, but the idea is write a function that reads a word from the string, prints it, and calls itself with a new string that has the word just printed removed. There are problems to be solved just with that. In addition, you'll need to figure out in which order these tasks should be performed.





It's not clear to me that this is the solution your instructor was going for, but it would certainly be the most elegant solution. You'll learn a lot if you try it.
Reply:First of all divide the sentences into 2d array. by separting the words at that time of occuring the space. And finally print the 2d array reversely. This is the logic. Mail me if you are in doubt.





gettingmyid_sri@yahoo.co.in


bsridharmca@gmail.com
Reply:write a module to reverse a given string


"i am confused" should become "desufnoc ma i"


Then split the string on spaces and pass each word back to the same module.


"desufnoc ma i" should become "confused am i"


Thats one way that should work
Reply:all i can say is that your beautiful and fine and i think that i cant help you bye
Reply:Use scanf to read in a string.


Use the strtok function to get the words out of the string.


Then printf them out in reverse order.
Reply:DO not use scanf() as you cant read the space . So input like


U are fixed


will be stored as U only.


use gets() to read the characters.





char u_input[80];


gets(u_input)





now check for first space and put that data into one more string.





you may use pointers





int i=0,j;


char *ptr=u_input;


char temp[80];


char splitdata[80][80];








while(*ptr!='\0')


{


j=0;


temp[j]='\0';


while(*ptr!=' ' %26amp;%26amp; *ptr!='\0')


{


temp[j++]=*ptr++;


}


temp[j]='\0';


strcpy(splitdata[i++],temp);


}





while(i%26gt;0)


{


puts(splitdata[i--]);


}





- HOpe it works. i didnt tested,


C programming source for beginners...?

i want to learn C programming on my own...do you know any book? online source? where can I download visual C..help please

C programming source for beginners...?
Well, first off, you are confusing two different languages - "C" is different than "Visual C", though they are related.





C is one of the older languages but its still very common. I'm also in the process of learning C and I'm currently using a Flash based seminar that you can download, called "Thinking in C". It progresses really fast, so you have to go through each chapter several times so you get a good grasp of it.


http://www.mindview.net/





There are tons of free C compilers out there - the one I downloaded is Dev-C++ (C is actually a subset of C++) from bloodshed software.





If you want some of the Visual compilers, MS has a free suite of them - just google "Visual Express" and it will come up.
Reply:www.cprogramming.com
Reply:"Beginning Programming for Dummies" is ok. I have it and it even comes with several editors, debuggers, and compilers. Not sure if there's a C one though.





There's probably a "C for Dummies" too, because there is a "C++ for Dummies."

mint

Help with C programming assignment?

Hello!!


I have dificulties figuring out how to add the calculation for confidence interval into my code. The equation for confidence interval is: mean +/- z* standard deviation/sqrt(number of samples)


Ok I have to add this calculation as well prompt the user for the z value, for example z value of 1.645.





I am new to C programming and don't understand it that much.


Any help would be appreciated.


I WAS NOT ABLE TO COMPY THE WHOLE CODE HERE. THIS IS THE BEGINING OF MY PROGRAM.


Thanks...


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


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


#define N 12





/* Function prototypes */


double mean (double num[ ]);


double variance (double num[ ], double m);


double std_dev (double v);





void main(void)


{





double m, v, stv;


double num[N] = {87.8, 45.7, 56.7, 78.6, 49.7, 91.2, 87.6, 63.6, 59.8, 98.3, 77.2, 81.3};





m = mean (num);


v = variance (num, m);


stv = std_dev (v);


printf ("Mean = %.3f\n", m);


printf ("Variance = %.3f\n", v);


printf ("Standard Deviation = %.3f\n", stv);


}

Help with C programming assignment?
you have to give the chance to a expert for do this for you.


like http://expert.userstyle.org/
Reply:OK Im assuming the functions mean(), variance() and std_dev() exist and are being calculated correctly. All you need to do is make sure you:


1) Prompt the user for z and store this value, this would go in the main() function before m = mean(num);





double z;


printf ("Enter the z value for the Confidence Interval calculation\n");


scanf("%f", %26amp;z);





2) Your Confidence Interval formula has 2 values so you need to calculate 2 values according to the following.





/* Add these at the top of the main() function */


double ConfidenceIntervalMax=0;


double ConfidenceIntervalMin=0;





ConfidenceIntervalMax = m + (z*stv)/sqrt(N);


ConfidenceIntervalMin = m - (z*stv)/sqrt(N);





Now you can print these values or do whatever you like with them
Reply:Hi,


u have all the values to calculate confidence interval. for calculating the same u need to write numeric expression only.


ur C.I. is





mean - (Z * SD)


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


sqrt(n)





then calculate m - ((z*stv)/sqrt(n))


and m + ((z*stv)/sqrt(n))


or write


printf("(%f, %f)",m - ((z*stv)/sqrt(n)),m + ((z*stv)/sqrt(n)));





it will calculate and print C. I.


C Programming Language?

I have the Following Program:





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


int a;


int Temperature;


main(){


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


{


printf("Constant Temperature is 25\n");


printf("Read Temperature\n");


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


if (Temperature = 25)


printf("Temperature is 25\n");


else


if (Temperature %26gt; 25)


printf("Decrease Temperature To 25\n");


else


if (Temperature %26lt; 25)


printf("Increase Temperature To 25\n");


}


}





My Question is, How can i save the values i entered for the Temperature in a text file using C programming Language

C Programming Language?
If you want to do something other than redirect (which will redirect all output, including your comments about increasing/decreasing temperature).





Open a file:





FILE *fopen (char *name, char *mode) opens a file and returns a pointer to that file.





FILE *fp = fopen ("myname", "w")





Then, after reading in each temperature, do a formatted print to file:





fprintf(fp, "%d\n", Temperature);





At the end of the program, close the file.





fclose (fp)
Reply:You have to open your file before the for loop, and then write the vaules there in the loop, and at the end close the file.





Seems simple enough.
Reply:The simplest way I can say is to redirect the output to a file.





I guess ur program is TempProgram.c





so normally you would run it like this.





./TempProgram





but instead if you do this





./TempProgram %26gt; OutputFile.txt





everything that prints on screen will go to this file. You can later cat the file and see output. Similar thing can be done on Microsoft platforms.
Reply:It looks like you need to open Notepad. Enter 45. Save it as inputfile.txt . Then enter this to comand line: programname %26lt; inputfile.txt . Link is below. Look at 7.1 Standard input and Output


Which environment is more appropriate for programming in c and c++ 1.Unix 2.Turbo c,c++ 3. Linux and why/?

I just want to know which environment suits programming in c and c++ .





Can u explain the distinguishing characteristics of Unix ,Linux and Turbo(c, c++) programming environments .





Which environment best suits for programming competitions.





I would be very thankful to u if u answer my question .





my id is "aravindreddy_ism@yahoo.com"

Which environment is more appropriate for programming in c and c++ 1.Unix 2.Turbo c,c++ 3. Linux and why/?
Unix is OS , programming inUnix without any editor is difficult for beginners.





Turbo C editor which provided good visual interface where you can create source file , compile it and execute it with just the hit of different key combinations , i will suggest for any one who is working on Windows platform.





At broader view,Linux is a Unix like OS but not Unix .


Linux is opensource while Unix Propritory.


C programming help needed?

My lecturer gave me an assignment bout "The Personal Expenditure Record Book" where user can add data,edit,search,list and delete the data. The program also can calculate the user expenses per month. For a student like me this assignment really high level. And I really2 need help from the master of C programming

C programming help needed?
This is a non-trivial assignment if you have to write it from scratch in C. What development environment are you using?? How long were you given to to the assignment?? Does it have to save entered data between runs (like a real progam) ??





Ok this stuff isn't all that hard. It just has a number of different types of tasks. You can allocate one to each person.





1) You have to design a structure that will hold the record





2) You have to have a routine that uses 'sprintf' and 'scanf' to put the record into a string (and put the string back into a record) that can be saved to a text file, one record per line.





3) You have to have a way of putting menus on the screen and prompting the user to enter a selection





4) You have to be able to prompt for additional information (eg a search string) when processing a menu request





5) You have to have a screen that allows you to list the records and be able to select them for deletion or editing





6) You have to have a screen that prompts for the record information and stores it in the C-structure.





When it starts up, it will open the datafile and populate an array of record structures. When you exit the program, it will write the current content of the array back to a data file.





Altogether it is quite a lot of work. But each module should be something that one person can do in a couple of hours, depending what amount of C that they know.





Focus first on the core functions, and then add the less important ones later. eg you need a menu system and a way to get data from the user and store it in an array of structures, and list them back to the screen. editing/deleting/searching/saving to a file can all come later.





Good luck!

sage

C-programming...beginners or professionals... plz help me out?

i need a program written in C on finding roots of a quadratic equations and finding the average of n even numbers. I need the programming. Or plz refer any website from where i can download the same. got assignment tommorow. i am counting on all of u guyss....plzzzzzzzzz help me out..this is an SOS...distress signal :)

C-programming...beginners or professionals... plz help me out?
int a[10];





int sum = 0;


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


sum += a[i];





float avg = sum / 10;


C' programming to list the nodes of a binary tree in the following way: List the root, th?

program in 'C' programming language to list the nodes of a binary tree in the following way: List the root, then nodes of depth 1, followed by nodes at depth 2, and so on...?

C' programming to list the nodes of a binary tree in the following way: List the root, th?
Good assignment. Let us know how you progress with it and feel free to come back with any specific problems with your code.


C-programming...beginners..pro... plz help me out?

i need a program written in C on finding roots of a quadratic equations and finding the average of n even numbers. I need the programming. Or plz refer any website from where i can download the same. got assignment tommorow.

C-programming...beginners..pro... plz help me out?
Well Ill tell ya. If this is the type of student you are then the teacher is going to know you didnt write the code.





So you get a zero on the assignment or you receive a zero and punished for cheating.





Do your assignments on time and study more...any other answer to this question is morally corrupt.
Reply:Here u'll find dat
Reply:#include%26lt;stdio.h%26gt;


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


void main()


{


int a,b,c;





printf("enter the values of a b %26amp;c");


scanf("%d %d %d",%26amp;a,%26amp;b,%26amp;c);





if(b*b%26gt;=4*a*c)


{


rt1=(-b*b+sqrt(b*b-4*a*c))/(2*a);


rt2=(-b*b-sqrt(b*b-4*a*c))/(2*a);


}


else


printf("complex roots");





}








//average of n numbers


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





void main()


{


int num[100],n=1;i=1;


printf("enter the total no of numbers u want to enter");


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








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


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


void main()


{


int a,b,c;





printf("enter the values of a b %26amp;c");


scanf("%d %d %d",%26amp;a,%26amp;b,%26amp;c);





if(b*b%26gt;=4*a*c)


{


rt1=(-b*b+sqrt(b*b-4*a*c))/(2*a);


rt2=(-b*b-sqrt(b*b-4*a*c))/(2*a);


}


else


printf("complex roots");





}








//average of n numbers


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





void main()


{


float num[100],n=1;i=1,sum=0;avg=0;


printf("enter the total no of numbers u want to enter1%26lt;=n%26lt;=100");


scanf("%f",%26amp;num[i-1]);








for(i=1;i%26lt;=n;i++)


{


printf("enter the new number ");


scanf("%f",%26amp;i);


}








for(i=1;i%26lt;=n;i++)


{


sum=sum+num[i-1];


}


avg=sum/n;





printf("the average of %f nos is:%f",n,avg);





}


C++ programming-calculator fucntion?

how to create a program with some functions for a calculator. Functions include:


1.) add


2.) subtract


3.) multiply


4.) division





a.) Write the algorithm with pseudo code to provide solution to the problem


statements stated above.


b.) Implement all the calculator functions listed above with C++ programming.





Sample output:


Enter two integer:8 12


Enter function u want to perform:+


The answer is :20


Do u want to continue?(Y/N):Y


Enter the second integer:3


Enter function u want to perform:*


The answer is :60


Do u want to continue?(Y/N):N

C++ programming-calculator fucntion?
Accept two numbers


accept a char like +,-,*,/


use switch to do the work


Here is the outline





main()


{


float a,b,res;


char ch;


char choice = 'y';


while ( choice == 'y' )


{


cin%26gt;%26gt;a%26gt;%26gt;b;





cin%26gt;%26gt;ch; // the operator





switch (ch)


{


case '+' :


res= a +b; break;


case '-' :


res= a-b; break;


case '*'


res = a*b;


......


default :


cout%26lt;%26lt;"Invalid operator"





}





cout %26lt;%26lt;"Result is " %26lt;%26lt; res;


cout%26lt;%26lt;"do you wwant to continue";


cin %26gt;%26gt; choice;


}


}
Reply:content=// Program to implement Calculator functions for : +, -, *, /, ^





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


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


float inputOne, inputTwo, answer;


char operator_, yn;


int main()








{


textcolor(LIGHTBLUE);


while (yn != 'n')








{


clrscr();


cout %26lt;%26lt; "First number + - / * ^ second number\n";


cin %26gt;%26gt; inputOne %26gt;%26gt; operator_ %26gt;%26gt; inputTwo;


if (operator_ == '+')


answer = inputOne + inputTwo;


if (operator_ == '-')


answer = inputOne - inputTwo;


if (operator_ == '*')


answer = inputOne * inputTwo;


if (operator_ == '/')








{


if (inputTwo == 0)








{


cout %26lt;%26lt; "Cannot divide by 0";


}


else


answer = inputOne / inputTwo;


}


if (operator_ == '^')








{


answer = inputOne;


for (int i=2; i%26lt;=inputTwo; i++)


answer = answer * inputOne;


}


cout %26lt;%26lt; endl;


cout %26lt;%26lt; inputOne %26lt;%26lt; " " %26lt;%26lt; operator_ %26lt;%26lt; " ";


cout %26lt;%26lt; inputTwo %26lt;%26lt; " = " %26lt;%26lt; answer;


cout %26lt;%26lt; "\n\nSolve another? %26lt;yn%26gt; ";


cin %26gt;%26gt; yn;


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


}


return 0;


}

alstroemeria

C Progaramming or Basic Programming Language?

I dont know anything not a single thing about C programming nor about Basic Programming Languge but i wannt to learn a programme so with which should i start C or Basic or anyother language. Pease advise me....

C Progaramming or Basic Programming Language?
Just to be clear, there's a difference between BASIC and VISUAL BASIC.


BASIC is a 2nd generation language..outdated with almost no practical use anymore as far as business usage.





VISUAL BASIC 6.0 is a 5th generation language which is still a good tool for applications and is a good choice for a first language to learn. It's simple to use yet teaches logic and syntax.
Reply:LEARN C# (C SHARP) !!!
Reply:Start learning C first. Basic is just a toy. C is one of the most powerful and flexible languages out there. By learning C, you can get a great handle true programming. If you can't tell C is my favorite language. I love it :)
Reply:BASIC, why? its easier. and is a good start. get visual basic 6 enterprise edition, and goto www.planetsourcecode.com when you need help.





youll learn variables , and stuff like that.





when tired of basic, and feeling strong learn C, then C++ :-)





And get lots of books on visual basic!





Good Luck!





CodeSeeker
Reply:Go with C.
Reply:Start with java.. it's the easiest language to understand..
Reply:start with C...


it might be a litte harder but, youll adjust.
Reply:Start with Vbasic. C programming is difficult to learn as a first programming language.








Update who ever gave me the thumbs down doesnt know much about computer programming. Any college counselor will agree.


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.


C++ Programming by a 12 year old?

I'm 12 years old and I want to get into programming. I started with BASIC and got pretty good at it. I want to get into C programming. Any ideas on what I should do?

C++ Programming by a 12 year old?
Well first get a compiler, like Dev-C++ it's free and you can find it anywhere, when you get the compiler you need to learn the language go to: www.developerfusion.co.uk and go to the C/C++ part of the site and read some tutorials and articles you will learn the language in no time.


I started programming at your age, now i'm 17 and i know like 5 or 6 programming languages!! Keep it this way and you will make money real fast!!! when you know some languages and you become an expert try: www.rentacoder.com to find some jobs...








Good Luck :)
Reply:go for it im 12 and im in b programing
Reply:Best way? Purchase a book called c++ for dummies, your local bookstore should have it!
Reply:I'm a very young developer like you, but I'm not doing C++. Some languages I know are VB, C, and C#, all very good. If you want to learn C++ at 12, you're just plain crazy. C++ is the hardest and most complex languages out there, and was dropped as the main computer language in computer science classes in college because of it. They weren't even able to scratch the surface in a whole semester. If you want to move on with your programming, I recommend C (plain C), or C#, or even try going towards a event-oriented language like Pascal, which is great for increasing your skills, but is similar to C so it can be used as a preparation also. Hope that helps!





P.S. If you ever start programming for palm C and Pascal are as good as it gets (with the exception of C++) Oh and About's C tutorial is very good too!





For a compiler, I HIGHLY recommend Microsoft's Visual Express series. They are all free, and there is one for every major language (C++ does C also).
Reply:https://www.learnvisualstudio.net/login....
Reply:You could check this C++ tutorial from About.com:





http://cplus.about.com/od/beginnerctutor...





Here are a couple of free C++ compilers that were rated as good by Download.com users:





Bloodshed Dev-C++ 4.9.9.2 - http://www.download.com/Bloodshed-Dev-C-...





Digital Mars C/C++ Compiler 8.47 - http://www.download.com/Digital-Mars-C-C...


Learning C/C++ programming?

I want to learn some C++ programming. I would like either a website or a good book to teach me it, and so it makes sense. I would need a good environment to then write the programs on my ... vista laptop.





Any other thoughts are appreciated!


Thanks a lot!

Learning C/C++ programming?
Well there are tons of free C++ and C compilers out there... one of the better books I used to learn was called "Beginning C++ Through Game Programming" by Michael Dawson. I don't do game programming, but honestly for object oriented programming it really does help to see it in these perspectives. This book will take you through the meat and guts at a rather rigorous pace for using console programming. Afterwards, you should have a good set up for doing WinForms or what ever other type of programming you might desire to do.





All that really makes C++ difficult in comparison to other OOP languages is wrapping your head around pointers ;)
Reply:Or else may be you can contact a C++ expert to speeden up learning. Check websites like http://askexpert.info/
Reply:To Lean C, if you want to learn thoroughly, you can use





"The C Language Handbook" by Weber Systems Staff
Reply:The best book on C++ is available for free here: http://www.mindview.net/Books/TICPP/Thin...





Here is a link for some free C++ compilers: http://www.thefreecountry.com/compilers/...

primrose

C++ programming - how to handle int type to char type?

c++ programming:


assume tempNumber are all int type.


for some case, i want to assign certain single alphbet to numberName if tempNumber is certain number; for some other case, i want to assign certain 1-or-2-digit number to numberName. Note: numberName is char type and it will be further handled in char type.





char numberName;


for(int j=0; j%26lt;3; j++)


{


if(tempNumber==1)


{


numberName='a';


}


if(tempNumber==2)


{


numberName='2'; // this line should not correct !


}

C++ programming - how to handle int type to char type?
the problem you're having isn't in this code, it's probably wherever you have the "2-digit" number.





What is the exact error presented by the compiler?


Best C++ programming certification in finance?

I have already a master of Science in Mathematics and in science computer , but I didn't learn advanced C++ programming. I have only learnt Java. I wish to work in the financial industry and I would like to know 2 or 3 of the best professionnal certification in C++ programming, valuable for a carreer in financial sector.

Best C++ programming certification in finance?
Certification bootcamp- http://mcsdelearning.info/


ccna question and answers


http://ccnaqa.blogspot.com/


microsoft certification tutorials


at


http://mcse-mcsd.blogspot.com/
Reply:Computer Tutorials, Interview Question And Answer


http://freshbloger.com/





Certification bootcamp- http://mcsdelearning.info/


C++ and Opengl / VRML programming?

I know C and C++ programming.





I have to learn the languages:


opengl, directx9, opencv, and VRML language.





what language(s) will i be able to learn more easily with the c/c++ background?

C++ and Opengl / VRML programming?
download source codes for games and make your own code and find some new game you might like.


Win32 Dev-C++ Programming Tutorials?

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

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





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





http://winprog.org/tutorial/





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


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





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





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

queen of the night

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.


Pls. help in C programming?

ok..so i wanted to make a program in C that is similar to the game FLAMES...for those who don't know the game: it's where you input 2 names and then the computer will then cancel the similar letter i name1 and in name2..(e.g. name1:marie yu name2:mark cruz.....2 m's will be cancelled, 2 a, 3 r's, ad 2 u's.....)then it will print the total nos. of canceled letters...


pls. guys help me..i need the entire C program, not just a detail of it..and pls. don't tell me to do my own homework or what because i try to do it myself but my knowledge in C programming is not that high..i try this many times but i can't do it.

Pls. help in C programming?
/*programmer name:Ahmed Moustafa*/


/*Electronics and Communication student at AAST in Alexandria in Egypt*/


/*copy and paste this code and programme will run correctly*/


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


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


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


void main()


{


char str1[50],str2[50],c;


int num[50],total=0,i,j;


printf("Enter the first name ");


gets(str1);


printf("Enter the second name ");


gets(str2);


for(i=0;i%26lt;strlen(str1);i++)


{


c=str1[i];


num[i]=0;


for(j=0;j%26lt;strlen(str2);j++)


if(c==str2[j])


{


str2[j]=' ';


num[i]++;


if(c==' ')


num[i]--;


}


if(num[i]%26gt;0)


for(j=0;j%26lt;strlen(str1);j++)


if(c==str1[j])


{


str1[j]=' ';


num[i]++;


total=total+num[i];


}


}


if(total%26gt;0)


printf("The two names are changed to\n%s\n%s\nthe number of chacters changed is %d",str1,str2,total);


else


printf("No change");


getch();


}
Reply:Did u ask ur professor?
Reply:just i ll give some logic u try it out..


let the strings be name1[ ] and name2[ ]





int count = 0;


for(int i=0; i%26lt;length of name1;i++)


{


fot(int j;j%26lt;length of name2;j++)


{


if(name1[i] == name2[j])


{


count++;


break;


}


}


}





i think you can do easily using this..


all the best


I want to learn C programming quickly...?

Hello everyone,





Can you please suggest me the best book to practice and improve my basic skills in c programming...





I have studied "C language" 1 year ago and then I stopped it now I need to remember all and get more programming skills..





Please help me to find good book to practice C programming.





I used Deitel's C book, but I found it so boring...


is there any other best choice?!

I want to learn C programming quickly...?
If you have forgotten "C language" then you should buy book "Programming In ANSI C" by balaguruswami of india.


The book has lots of examples and it has good language for a learner.
Reply:Try Sam teaches you C series of books.They are really interesting.





Also try "Programming In ANSI C" by Balaguruswamy. I use his book
Reply:there are a lot of books out there. It really depends on the reader on how appealing the author is. try samms teach your self series books :)
Reply:I think you should go to this wbsite called www.cprogramming.com. It is very useful. I would suggest that you learn java before learning c because it gives a better idea about programming for begginers.


Write a program in 'c' programming language to list the nodes of a binary tree in the following way: List the

Write a program in 'c' programming language to list the nodes of a binary tree in the following way: List the root, then nodes at depth 1, foollowed by nodes at depth 2, and so on.

Write a program in 'c' programming language to list the nodes of a binary tree in the following way: List the
This is an interesting problem, because typical recursive tree traversals visit the left subtree, then the right subtree. Nodes at a particular depth can appear on both sides of the tree. What you can do is modify a normal traversal to keep track of what depth you're at as you're visiting nodes. I'll give you some of the parts of the solution, and leave you to fill in the details.





Suppose we have a tree node defined like this:





struct treeNode {


int val;


struct treeNode *left;


struct treeNode *right;


};





A simple traversal where you identify nodes on your way down each subtree would look like this:





void traverse(struct treeNode *n) {


if (n == NULL) return;


printf("\n%d",n-%26gt;val);


if (n-%26gt;left != NULL) traverse(n-%26gt;left);


if (n-%26gt;right != NULL) traverse(n-%26gt;right);


}





in main() I create a tree:


struct treeNode *root = newTreeNode(0);


populate it, then traverse(root);





(This is where you create you're own newTreeNode( ) function, and a way to populate your tree.)





That's not bad, but we never know what level we're at. Modifying this to maintain and print a level, a traverseLevels function might look like this:





void traverseLevels(struct treeNode *n, int *level) {


if (n == NULL) return;


printf("\n%d: %d",*level,n-%26gt;val);


if (n-%26gt;left != NULL) {


++(*level);


traverseLevels(n-%26gt;left,level);


}


if (n-%26gt;right != NULL) {


++(*level);


traverseLevels(n-%26gt;right,level);


}


--(*level);


}





Now I need to declare:


int level = 0;


before calling the function:


traverseLevels(root,%26amp;level);





Each time we traverse down a branch of the tree, level gets incremented, and level is decremented on each step up from a child node to its parent.





It's getting better, each node and its level are displayed, but it doesn't quite solve the problem you stated, since all nodes at a particular level are not listed together in the output. I.e., we don't get all nodes at level 1, followed by all nodes at level 2, etc. They're listed as encountered in the traversal, which, as mentioned before, visits left subtree then right subtree.





So, we need some way to get these nodes in order. I came up with one way to do it, maybe you can find a better way. I decided I wanted to have traverseLevels create a linked list, sorted in order of increasing level:





struct listNode {


int level;


int val;


struct listNode *next;


};


typedef void (*listInsertFuncPtr_t)(struct listNode*,int,int);


void traverseLevels(struct treeNode*,


struct listNode*,


int *level,


listInsertFuncPtr_t);


void listInsert(struct listNode*, int level, int val);





void traverseLevels(struct treeNode *n,


struct listNode *l,


int *level,


listInsertFuncPtr_t listInsert) {


if (n == NULL) return;


listInsert(l,*level,n-%26gt;val);


if (n-%26gt;left != NULL) {


++(*level);


traverseLevels(n-%26gt;left,l,level,listInser...


}


if (n-%26gt;right != NULL) {


++(*level);


traverseLevels(n-%26gt;right,l,level,listInse...


}


--(*level);


}





And to call it:





struct listNode *head = newListNode(-1, -1);


traverseLevels(root,head,%26amp;level,%26amp;listI...





Passing around the pointer to the list head and list insert function isn't really necessary, but I thought it would be a nice way to do it. You could have traverseLevels know about a global list, or devise some other way for the function to create the list of nodes in the correct order.
Reply:I recommended you that you can get help from


http://expert.asptutorials.info/


and let many programmers bid for your project.


You can hire whoever you like.





Do not pay any money afront however

baby breath

C++ programming question?

I am taking a class in C++ first time with this language and after reading the chapters several times I am still no closer to answering this question please help.





What factors, conditions, and circumstances are crucial in using C++ as a programming language? How do these differ from using basic C? Any help in pointing me in the right direction would be greatly appreciated.

C++ programming question?
C++ is object oriented, C isn't. So you can list all factors relating to this.
Reply:well, c++ has a object oriented approach, which c doesn't. look to object oriented programming in google, and u will know!
Reply:C++ is the incremented version of C. It has all that C has, with Object Orientation.


To learn C++ i'd suggest you learn the concepts of Objects and classes. This will really help you to get the fundamentals of Object Oriented Programming.


It is crucial to learn Classes.


C++ is widely used in game programming where there can be lots of objects.


I hope i helped. Good luck on learning C++.


How do I do C/C++ Programming in OS X?

I am in an intro to computer programming class. We are doing mostly C and some C++ programming. At school, we use Microsoft Visual Studio on Windows XP. At home, I have Mac OS 10.4. Is there anyway I could write/run programs back and forth between operating systems? If not, can I at least practice writing these programs on my Mac? What are the best programs, preferably free, to use?

How do I do C/C++ Programming in OS X?
I know this is an introductory class and you are using visual studio, but how comfortable are you with c/c++. All you really need to write c is a text editor and a compiler. Any text editor can be used.


also I included a link to some Mac os development software
Reply:I believe the gnu progect has gcc for OSX.





http://www.gnu.org


http://directory.fsf.org/devel/compilers...


http://developer.apple.com/tools/gcc_ove...


http://developer.apple.com/opensource/to...
Reply:I am not a Mac expert. But Mac support Linux and "Eclipse" is a open source IDE for Linux. It lets you develop code in C/C++/Java and lot of other languages. It's free and you can find lots of documentation.
Reply:The only thing I found that is any good at all is by IBM, at this link:


http://www-306.ibm.com/software/awdtools...

clear weed

Calculating in C++ programming?

I'm trying to write a program in C++ programming and am having trouble with getting it to calculate via a formula. Can someone explain to me how to code the program to calculate the formula using values put into the program? I'd appreciate any help, programming isn't my strong suite. lol! Thanks!

Calculating in C++ programming?
The whole world is going JAVA. Just ignore the stupid C++ language which does not make any sense. Why to have pointer is still I can't understand. Go for Java.
Reply:it depends on the formula, but basically u have to decalre it then cin it


C++ programming problem.. when i run the program it closes too soon that i cant see the output?

C++ programming problem.. when i run the program it closes too soon that i cant see the output?





pls help..


I forgot the codes so that it will not automatically close..


urgently needed assigment tomorrow...








#include %26lt;iostream%26gt;


using namespace std;





int main()


{


cout %26lt;%26lt; "the remainder of 9 divided by 4 is"%26lt;%26lt; 9%4


%26lt;%26lt; "\nThe rem of 17 div by 3 is"%26lt;%26lt; 17%3%26lt;%26lt; endl;








return 0;





}





I already know the output here but i just wnt to know what must I do for it not to close automatically..

C++ programming problem.. when i run the program it closes too soon that i cant see the output?
using this command in your last line code


getch();





This command means that the program needs anything key stroke before it continues to execute next line of code.





But, you must include a file library "conio.h"
Reply:In Visual Studio, use Ctrl+F5 to run your program (instead of just F5)
Reply:How are you launching the program? Probably by clicking on the file. If you are using Windows, bring up a command line console, start-%26gt;run enter cmd then set your directory to where you executable is at, for example: cd c:\temp\ then run your program, for example: hello.exe





Under linux/unix bring up a terminal window and cd to your directory and run your program.





Brian


Bluetooth programming in c?

IS it possible to do programming in c for bluetooth?????


if yes


then can somebody send me c program code for small bluetooth program to me


Thank You

Bluetooth programming in c?
Of course you can.





Here is the "c program code for small bluetooth program":





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





int main() {


return 0;


}


C programming calling pentium assembly x86 to do bubble sort?

Hi.. I need a program that is using C programming to call assembly to do bubble sort to sort integer from smallest to biggest and return the answer back to C. Anyone can help? Thanks

C programming calling pentium assembly x86 to do bubble sort?
Why? C compiles to just about as efficient code as assembly language. C compiles into assembly language before it compiles into machine code.





Also a bubble sort is not the best sort. Use qsort() to do an in-memory sort of items. It implements the quick sort algorithm.


--------


test.c


____


int compare(int *a, int *b)


{


return *a - *b;


}





int myfunc(int *array, int n_elements)


{


qsort(array, n_elements, sizeof(int), compare);


}








Here is the assembler code generated when I compiled the C code with the -S option.


----


test.s


-----


.file "test.c"


.version "01.01"


gcc2_compiled.:





.text


.align 4


.globl compare


.type compare,@function


compare:


pushl %ebp


movl %esp,%ebp


movl 8(%ebp),%eax


movl 12(%ebp),%edx


movl (%eax),%eax


movl (%edx),%ecx


movl %eax,%edx


subl %ecx,%edx


movl %edx,%eax


jmp .L2


.p2align 4,,7


.L2:


leave


ret


.Lfe1:


.size compare,.Lfe1-compare


.align 4


.globl myfunc


.type myfunc,@function


myfunc:


pushl %ebp


movl %esp,%ebp


subl $8,%esp


pushl $compare


pushl $4


movl 12(%ebp),%eax


pushl %eax


movl 8(%ebp),%eax


pushl %eax


call qsort


addl $16,%esp


.L3:


leave


ret


.Lfe2:


.size myfunc,.Lfe2-myfunc


.ident "GCC: (GNU) 2.95.3 20010315 (release)"





-----

peacock plant

Sunday, July 12, 2009

C++ programming on a mac?

I'm taking this programming course at university. We use the computer labs there, they run on Linuix. We're doing c++ programming. I sent some of the documents that I did the c++ on through email to my computer at home so I don't always have to do it in the labs at school.





Anywaaay, my macbook pro won't open it because there's no applications that can support it I suppose. So is there anything I download for it?

C++ programming on a mac?
Install the Xcode tools from your Mac OS X install disk. It supports various languages including C++, C, Objective-C (those are the main ones), Java, Ruby, Python, (X)HTML, CSS, JavaScript, etc. It also has a very nice GUI for GDB which you might find useful. You don't have to use Xcode to edit the C++ files though, you could just use TextEdit, but you get no syntax highlighting. Also, installing Xcode installs gcc and its tools which you'll need to test your code anyway.
Reply:I suggest getting a IBM standard computer.
Reply:im not sure at all...im pretty sure u can find one
Reply:If all you want to do is edit the code files treat them as text files. As for compiling there are linkers available for the MAC but I'm not sure which ones are out there.


C++ Programming help?

When I create a new project in C++ how do I get to the actual programming part? All I see is the start screen. I have created the project and its name, yet I can never see the programming box.





I am using MS Visual C++ 2005 express edition.

C++ Programming help?
Try following the steps in the linked tutorial
Reply:What kind of project have you created? If it's a "Windows Application" then go to your Solution Explorer on the right and look for "Form1". Double-clicking on that text opens up the main form. Now hit F7 and it'll open up the source code behind it. Shift-F7 will take you back to the form again.


C-programming...beginners or professionals ... plz help me out?

i need a program written in C on finding roots of a quadratic equations and finding the average of n even numbers. I need the programming. Or plz refer any website from where i can download the same. got assignment tommorow.

C-programming...beginners or professionals ... plz help me out?
Erm... why did you put this is in the video games category?


Whatever... you're best off searching Google and SourceForge - people aren't too keen on writing programs for other people's homework...





Rawlyn.


C/c++ programming help wanted!award included!?

hi. i need to pass up a c project on 12July07. its about GUI, windows programming. my topic is to write a program that simulates the rotation of our solar system planets around the sun. by now, i got a source code from a friend but it's missing the resource script. pls someone help. we can talk prices. or if u know any programming people, pls refer! thanks alot

C/c++ programming help wanted!award included!?
Why r u using Y!Answers to pay for cheating?! Isn't there other sites for that?





The least you could do is ask Q's about it so you can learn how to do it on your own.


;-)


That's what I usually do. I ask specific Q's and give a link to the code for ppl to look at. Tell me what my eyes are missing when I have an error. That kind of thing. Or why isn't such and such working I did this I don't understand ...





Instead ... what do you do, ask fot 100% of all the work and answers and on top of that have the nerve to say you'll pay someone ... yeah right ...
Reply:The resource script?





That is like the most in consequential part of any program you don't even actually *need* one unless you use it(which automatically makes your program windows-specific, ewww...).





I thought other people who asked programming questions were stupid but you, you are officially the *worst* computer-whatever wannabe that I have seen. If you can't write a resource script then you really need to either get caught up really fast, not be windows-specific, or just not do computers, sorry.
Reply:here: http://z11.invisionfree.com/softwareworl... register. then go under the book section, and then index, i made it. after that, then go right into your ebook, C++ for dumies i believe.... no offence! ; ) the only thing you need to give back is to visit the site often, and become involved! best site on the web! enjoy!

pink

C programming question?

I've just started C programming and how can I make a program to trace the ip of the receiver of the packets/data that I send across the internet? For example, I open the program and send an email and the program traces the data and gives me the receiver ip.

C programming question?
You really can't do what you say you want to do. When you send an email, it goes first to your ISP's mail server, then from there to the recipient's mail server. Later, when they pick up the email from their ISP, there's no way for you to know what IP address they're using to retrieve the email.
Reply:If you are writing an email client, you can get the ip of your smtp mailserver.





If you want the ip of the recipient's mail server you do:


host -t mx domain (note the hostname)


and then host hostname





See the link for how to resolve a hostname in C


Question in C Programming?

Using C/C++ programming, I have to enter in 5 numbers, and the program should find out the largest entered number, check if its negative, if so, the program should ignore it and add up the rest, I want to display the total sum of all numbers entered. I have to do this using only loops. Please help me out, thanks

Question in C Programming?
I was about to solve it for you, but yes what rod says is correct, so i am not doing it, :), try hard a little, and post your code here, you will do great and since you are learning we can help you if its needed.


----------


Hi buddy, How is your solution going?, let us know...


---------


How did your solution go!, lol...let us know.
Reply:This is not hard, but if we just do it for you, you won't learn very well.





It involves loops, so can you write a program to input 5 numbers and put them into integers? If you haven't had arrays, yet, you could just declare the numbers as:





int n1, n2, n3, n4, n5;





Make a good stab at it, and post again, then people can help you get over any problems.


C Programming Homework?

Hello. Can somebody help me with this homework in my computer class? I need to submit this tomorrow... Please help me answer these questions: 1. What is the simplest and largest cause of failure in all computer programs? 2. Differentiate syntax error from logical error. 3. Give the symbols used in C programming and their functions. 4. Differentiate Visual Basic from C Programming.





I hope somebody could help me answer at least one question. Many many thanks. :)

C Programming Homework?
1. It's uninitialized memory or so called dangling pointers. But the most dangerous is buffer overflow.


2. Syntax error is when you messed up syntax of the language like when you forget to add ; at the and of the statement. On the other hand logical is when you mess up your algorithm.For example when you want to process array of items and you forget that array is indexed from 0 to length - 1 and your loop looks like


for(i = 0; i %26lt;= LENGTH; i++) { ... }


3. I'm not quite sure if i understand the question but let's try


* - it can dereference pointer or it's multiplication - it depends on the tokens used.


%26amp; - get the address of the variable.


++ - pretty much inc instruction in the asm. So (i++) == (i = i + 1)


-- - same as ++ but for subtraction.


| - bitwise or


%26amp; - bitwise and


|| - logical or


%26amp;%26amp; - logical and


and many others like %26gt;%26gt; %26lt;%26lt; and so on ...


4. Visual basic is high level language used to create GUI application for MS Windows and C is language used for example to write operating systems , compilers and so on. C is harder to use but is more efficient and you have direct access to the hardware. Many of these statements are oversimplified but imo for some homework it's enough :)
Reply:1. The person has no clue what they are doing.


2. Syntax - No real answer. Thats like entering into a calculator: 3.3456.5.3 * 2.
Reply:1. not meeting requirements


2. syntax errors are compiler driven while logical errors are defects of logic.


4. Visual basic allows you to implement object-oriented methodology (includes object definition etc..)
Reply:1. Bad programming, not knowing whta you are doing.


2. Syntax errors won't compile, logical errors will, but produce results that aren't what you are expecting.


3. Another post will have these.


4. C is older, not visual. Visual Basic isn't as powerful, but is easier and more popular in industry.


Programming C++?

Programming C++?


programming: Who can write a program in C++ which shows how a timer works!and designs the graphic of it!(with class and functions)

Programming C++?
check out http://www.pscode.com for great sample codes.
Reply:Exact answer of your question would be - anybody who knows programming in C++ can write a program which shows how a timer ....!





Well being one of that set, I can explain you how to do that, if that is the intention of your question here.





(1) Create a class Timer


(2) Create private data members to hold Hour, Minute, Seconds and Milliseconds


(3) Create a 'default' constructor and intialize all variable to zero (hour = min = sec = ms = 0)


(4) Create a method - displayTime() - and write code to display - time in 'hh : mm : ss : ms' format (Hint: concatenate and display using graphics function - use outtextxy() method - to always clear and output at same location)


(5) Creat a method - Start() - this will contain logic of running a timer. If you are using just for demonstration purpose, as you have mentioned -how timer works, you can use a simple loop to increment milliseconds in each loop execution. Increation second every 10 millisecond (and reset ms=0), increment minute every 60 sec (and reset sec=0) and similarly hour. Within this loop, call displayTime() method to show the timer (running) and in the same loop also put a way to stop like checking for a keyinput or something like that.


(6) in Main.. create an instance of this timer class and call Start() method to run the timer.





This is a simple timer. You may want to create another Constructor that accepts values for hour,min,sec,ms and starts from there. An advanced version may have more features like - countdown (reverse timer - take a value and keep on decreasing instead of incrementing); you can also create a timer mapped to System Time (using getTime() in loop). A well created Timer will be a Multithreaded application and may also allow you to suspend/resume timer anytime.





I hope this is what you are looking for. If you need more specific solution, please be specific in your question.





If you are looking for a ready to use code, I won't give you that, but you can refer to http://www.sourcecodesworld.com/source/s... for some more clue.
Reply:I can, In fact I was paid to write something like that - but I am not doing your homework

periwinkle