Write a C program that displays the title, Currency Conversion, and then write the names of five currencies and their equivalents to the US dollar. The conversions are hard-coded equations in the program. Insert appropriate comments in the program to document the program. Also, as a version-control exercise, in the source code, at the end of the program file, create version levels and comments for each iterative attempt while creating the program.
Can someone give me an idea of how to write a simple C program? I have no programming experience!?
Buy the book, read it and try it. Nobody can teach you to program, you need to do it to learn it.
Reply:It will be more beneficial if you learn to do it yourself.
Monday, May 24, 2010
How do I get an executable out of my basic C# program in Visual Studio?
I'm a rookie at Visual Studio/.NET. I just coded my very first 'Hello World' C# program. It works fine within Visual Studio when I try to run it. I've tried build. I want my program to be a standalone .exe (executable) that I can run from a dos prompt. It's just a simple console application. What do I need to do (step by step) to get an executable version of it? What am I missing? All I have is the .cs source code. Thanks in advance.
How do I get an executable out of my basic C# program in Visual Studio?
If you can execute your application from visual studio then that means that you already have an .exe and Visual Studio simply runs it!
The .exe is located in the "bin/debug" or "bin/release" directory which is inside your project directory.
If you have Visual Studio 2003 the directory of your project is usually at "my documents/visual studio projects"
If you have visual studio 2005 it's usually at "my documents/visual studio 2005/projects"
Reply:compile it from the build menu. you might have to adjust your toolbars if its not showing up.
How do I get an executable out of my basic C# program in Visual Studio?
If you can execute your application from visual studio then that means that you already have an .exe and Visual Studio simply runs it!
The .exe is located in the "bin/debug" or "bin/release" directory which is inside your project directory.
If you have Visual Studio 2003 the directory of your project is usually at "my documents/visual studio projects"
If you have visual studio 2005 it's usually at "my documents/visual studio 2005/projects"
Reply:compile it from the build menu. you might have to adjust your toolbars if its not showing up.
How do I create my own Instant Messenger Program using C++?
I wish to know how to create my own Instant Messenger Program using C++. I haven't got a clue as to how to do any programming, so I need to start from the beggining. If at all possible, I'd like the source code and I can modify from there.
How do I create my own Instant Messenger Program using C++?
You could download the sources for GAIM which are written in C and update them to C++ and modify them for your use.
Reply:try looking into sockets and that library. when you have a simple TCP/IP client server running you will begin to understand the complexities. Java has a class that you can expand into a simple one, but there are a lot of quirks that have to be handled in a pro job
flower beds
How do I create my own Instant Messenger Program using C++?
You could download the sources for GAIM which are written in C and update them to C++ and modify them for your use.
Reply:try looking into sockets and that library. when you have a simple TCP/IP client server running you will begin to understand the complexities. Java has a class that you can expand into a simple one, but there are a lot of quirks that have to be handled in a pro job
flower beds
How to implement meta character in linux shell with c++?
I want to implement a new shell in the linux and put some new commands with c++.so, I need to handle meta character also.plz tell me how to write the commands and handle meta characters?
plz help me where i can find the source code to implement a new linux shell and put some commands?
How to implement meta character in linux shell with c++?
yoda the wise one here is your link
http://www.google.co.uk/search?hl=en%26amp;q=H...
plz help me where i can find the source code to implement a new linux shell and put some commands?
How to implement meta character in linux shell with c++?
yoda the wise one here is your link
http://www.google.co.uk/search?hl=en%26amp;q=H...
Problems in Creating a new project in Visual C++ 2008 Exprees Edition?
I have installed Visual C++ 2008 Express Edition. When I want to
create a new project, it tells me (creating file ??? failed).
If I open a source code, I can't compile it because I don't have the
menu button for it. But I was able to do all these things in my
university's lab.
I use windows Visa Home premuim and tried giving administrator rights
to VC++, but no effect.
What should I do? I have to use VC++...
Problems in Creating a new project in Visual C++ 2008 Exprees Edition?
I have the 2008 express edition. It gave me a whole lot of problems at first, then i figured out, I have to first create a sinlge file, and then copy and paste it into a already existing project. That's what i do, but i dont know how it is supposed to be done. There should be some sample projects already made with the software.
create a new project, it tells me (creating file ??? failed).
If I open a source code, I can't compile it because I don't have the
menu button for it. But I was able to do all these things in my
university's lab.
I use windows Visa Home premuim and tried giving administrator rights
to VC++, but no effect.
What should I do? I have to use VC++...
Problems in Creating a new project in Visual C++ 2008 Exprees Edition?
I have the 2008 express edition. It gave me a whole lot of problems at first, then i figured out, I have to first create a sinlge file, and then copy and paste it into a already existing project. That's what i do, but i dont know how it is supposed to be done. There should be some sample projects already made with the software.
Can anyone refer me to an online text to learn C++?
I've searched around, and have found many, many websites that claim to been able to teach C++. Yet only one has even remotely nabbed my interest. This is due to the fact that the author still left his/her teachings in an "incomplete" state.
I have done numerous searches (all major engines) and all of them fall short, don't make any sense, or the source code examples do not actually work. I have tested the more basic samples and they seem to work just fine. (i.e. the "Hello World!" mini-program)
I DO know how to "link and compile," so again, the tool(editor) I'm using works just fine.
So to the point then: Has anybody seen, or heard of, a REALLY GOOD, REALLY SIMPLE website that teaches C++?
Perhaps maybe there is a "backwoods" site that is not listed, but is friggin great. If there is such a thing, awsome, if not...Who's got some time?
Can anyone refer me to an online text to learn C++?
Here are the list of websites which can help u.
If u want to know more let me know.I am providing the link for the CPPbook which will be good i think.check out the bottom most link (www.fh-augsburg.de/~andreasb/).
If u want any suggestions do mail me,always welcome
Reply:Check out this from Wikibooks: http://en.wikibooks.org/wiki/Programming...
Reply:here ya go....
I have done numerous searches (all major engines) and all of them fall short, don't make any sense, or the source code examples do not actually work. I have tested the more basic samples and they seem to work just fine. (i.e. the "Hello World!" mini-program)
I DO know how to "link and compile," so again, the tool(editor) I'm using works just fine.
So to the point then: Has anybody seen, or heard of, a REALLY GOOD, REALLY SIMPLE website that teaches C++?
Perhaps maybe there is a "backwoods" site that is not listed, but is friggin great. If there is such a thing, awsome, if not...Who's got some time?
Can anyone refer me to an online text to learn C++?
Here are the list of websites which can help u.
If u want to know more let me know.I am providing the link for the CPPbook which will be good i think.check out the bottom most link (www.fh-augsburg.de/~andreasb/).
If u want any suggestions do mail me,always welcome
Reply:Check out this from Wikibooks: http://en.wikibooks.org/wiki/Programming...
Reply:here ya go....
How can I make letters instead of numbers appear in base16 number in c++?
I'm doing a decimal to hexadecimal c++ program. However, instead of displaying A (or B or C or D or E or F), it displays 10 (or 11 or 12 or 13 or 14 or 15) instead. Here's the source code:
#include %26lt;iostream.h%26gt;
#include %26lt;math.h%26gt;
using namespace std;
int main ()
{
int input, i, j, k, result, power, hex_dig;
char hex_letter;
i = 1;
j = 0;
power = 0;
system ("cls");
cout %26lt;%26lt; "Enter an integer number [1-50]: ";
cin %26gt;%26gt; input;
k = i;
result = 0;
power = 0;
while (k %26gt; 0)
{
j = k % 16;
k = k / 16;
if (k %26lt; 10)
{
result = result + (pow(10,power) * j);
power = power + 1;
}
else if (k == 10)
{
hex_letter = 'A';
cout %26lt;%26lt; hex_letter %26lt;%26lt; j %26lt;%26lt; endl;
}
else if (k == 11)
{
hex_letter = 'B';
cout %26lt;%26lt; hex_letter %26lt;%26lt; j %26lt;%26lt; endl;
}
else if (k == 12)
{
hex_letter = 'C';
cout %26lt;%26lt; hex_letter %26lt;%26lt; j %26lt;%26lt; endl;
}
else if (k == 13)
{
hex_letter = 'D';
How can I make letters instead of numbers appear in base16 number in c++?
Store the k % 16 values of each iteration in a string of characters.
If (k %16) %26gt; 9, then 10 ≡ A ; 11 ≡ B ; 12 ≡ C ; 13 ≡ D ; E ≡ 14; F ≡ 15.
In the next step reverse that string using the function ' strrev() '.
That is your equivalent hexadecimal number
Reply:use C# -_-
Reply:I see that you read an integer into input, but I don't see where you do anything with that integer.
Why do you reinitialize hex_letter in each if else statement? Why not simply output the intended letter.
Or you could add 85 to each number, then 10 would equal 95, and 11 would equal 96, then cout the number without quotes and a letter will display. This would also eliminate all your if else statements.
95 in ASCII is capital A, 96 is B, etc.
You should also end your if else with an else, in the event none of the previous if else statements are entered.
wedding flowers
#include %26lt;iostream.h%26gt;
#include %26lt;math.h%26gt;
using namespace std;
int main ()
{
int input, i, j, k, result, power, hex_dig;
char hex_letter;
i = 1;
j = 0;
power = 0;
system ("cls");
cout %26lt;%26lt; "Enter an integer number [1-50]: ";
cin %26gt;%26gt; input;
k = i;
result = 0;
power = 0;
while (k %26gt; 0)
{
j = k % 16;
k = k / 16;
if (k %26lt; 10)
{
result = result + (pow(10,power) * j);
power = power + 1;
}
else if (k == 10)
{
hex_letter = 'A';
cout %26lt;%26lt; hex_letter %26lt;%26lt; j %26lt;%26lt; endl;
}
else if (k == 11)
{
hex_letter = 'B';
cout %26lt;%26lt; hex_letter %26lt;%26lt; j %26lt;%26lt; endl;
}
else if (k == 12)
{
hex_letter = 'C';
cout %26lt;%26lt; hex_letter %26lt;%26lt; j %26lt;%26lt; endl;
}
else if (k == 13)
{
hex_letter = 'D';
How can I make letters instead of numbers appear in base16 number in c++?
Store the k % 16 values of each iteration in a string of characters.
If (k %16) %26gt; 9, then 10 ≡ A ; 11 ≡ B ; 12 ≡ C ; 13 ≡ D ; E ≡ 14; F ≡ 15.
In the next step reverse that string using the function ' strrev() '.
That is your equivalent hexadecimal number
Reply:use C# -_-
Reply:I see that you read an integer into input, but I don't see where you do anything with that integer.
Why do you reinitialize hex_letter in each if else statement? Why not simply output the intended letter.
Or you could add 85 to each number, then 10 would equal 95, and 11 would equal 96, then cout the number without quotes and a letter will display. This would also eliminate all your if else statements.
95 in ASCII is capital A, 96 is B, etc.
You should also end your if else with an else, in the event none of the previous if else statements are entered.
wedding flowers
Setting different screen sizes in C#?
Is there a way to have a C# application set one display to 1024x768 resolution and a second monitor to 800x600 resolution. If someone could either please provide the source code or provide a link to a driver that does the same thing, I would appreciate it.
Thanks!
Setting different screen sizes in C#?
My Nvidia g-force video card has that built in or can even set #1 for my monitor and #2 for a TV. ATI cards have that option also. Don't know about doing that in C, I only use turbo pascal and never tried to do it.
Thanks!
Setting different screen sizes in C#?
My Nvidia g-force video card has that built in or can even set #1 for my monitor and #2 for a TV. ATI cards have that option also. Don't know about doing that in C, I only use turbo pascal and never tried to do it.
I can use note pad to open a website to look at the source but not from the drop down menu in the browser?
I can use note pad to open a website to look at the source but when I try to view the the source code of a website from the browser drop down menu, I can not even my own site , even off line I get a pop up box with the title C\windows\system32\notepad.exe
The message says ..Windows cannot access the specified drive,path or file. You may not have the approprite permision to access them...............this has only started recently is it a windows security issue to do with XP ? Can anybody advise me..thanks
I can use note pad to open a website to look at the source but not from the drop down menu in the browser?
this prevents people from hacking and exploiting your site it is a security by .net frame work 2 and sp2 for xp. even u cant access ur own sites source code as some hacker may copy your ip and so on. so the only way is to do it from the website u used
paid survey
The message says ..Windows cannot access the specified drive,path or file. You may not have the approprite permision to access them...............this has only started recently is it a windows security issue to do with XP ? Can anybody advise me..thanks
I can use note pad to open a website to look at the source but not from the drop down menu in the browser?
this prevents people from hacking and exploiting your site it is a security by .net frame work 2 and sp2 for xp. even u cant access ur own sites source code as some hacker may copy your ip and so on. so the only way is to do it from the website u used
paid survey
I can use note pad to open a website to look at the source but not from the drop down menu in the browser?
I can use note pad to open a website to look at the source but when I try to view the the source code of a website from the browser drop down menu, I can not even my own site , even off line I get a pop up box with the title C\windows\system32\notepad.exe
The message says ..Windows cannot access the specified drive,path or file. You may not have the approprite permision to access them...............this has only started recently is it a windows security issue to do with XP ? Can anybody advise me..thanks
I can use note pad to open a website to look at the source but not from the drop down menu in the browser?
Hi,
I believe this link can solve your problem. It's not exactly on the same subject, but it shows how to modify your registry / IE7 to use notepad...
http://blogs.msdn.com/ie/archive/2007/03...
Hope this helps
The message says ..Windows cannot access the specified drive,path or file. You may not have the approprite permision to access them...............this has only started recently is it a windows security issue to do with XP ? Can anybody advise me..thanks
I can use note pad to open a website to look at the source but not from the drop down menu in the browser?
Hi,
I believe this link can solve your problem. It's not exactly on the same subject, but it shows how to modify your registry / IE7 to use notepad...
http://blogs.msdn.com/ie/archive/2007/03...
Hope this helps
Applying an amplitude envelope to array data in C++??
I have the raw data for a sound file in an array and I need to apply an amplitude envelope (attack - decay - sustain - release) to it using C++. Preferably I'd like the user to be able to adjust the times for each part of the envelope but this is not essential. I have 44100 samples in the array. I know I need to use a separate for loop to apply each part of the envelope to the necessary samples, and I've pretty much got my head around doing the attack part, but I'm having difficulty working out how to do the rest. I know the sample rate and everything, so the length of the sound can be calculated easily, it's just that when it comes down to actually applying the envelope I get confused!
I'm only making a console application, none of this visual stuff, so I just want the source code really.
Any suggestions for code, or even just ideas as to what processes I need to go through, would be much appreciated!
Many thanks!
Applying an amplitude envelope to array data in C++??
Suppose you had separate arrays for your A, D, S, R data, comprising floating point numbers, multiplication factors, between 0 and 1 inclusive.
Now allocate a floating point array equal in length to your sound sample data. Call this the "envelope array." Since you're a C++ guy, use new and remember to use delete after you're done with it.
Figure out how many samples long your attack, for example, should be. Then copy from your attack array into the floating point array you allocated... using linear extrapolation if you need more attack values, or skipping some if you need fewer.
Do the same for your decay, sustain, release. Then multiply your sample values by your envelope array values.
I'm only making a console application, none of this visual stuff, so I just want the source code really.
Any suggestions for code, or even just ideas as to what processes I need to go through, would be much appreciated!
Many thanks!
Applying an amplitude envelope to array data in C++??
Suppose you had separate arrays for your A, D, S, R data, comprising floating point numbers, multiplication factors, between 0 and 1 inclusive.
Now allocate a floating point array equal in length to your sound sample data. Call this the "envelope array." Since you're a C++ guy, use new and remember to use delete after you're done with it.
Figure out how many samples long your attack, for example, should be. Then copy from your attack array into the floating point array you allocated... using linear extrapolation if you need more attack values, or skipping some if you need fewer.
Do the same for your decay, sustain, release. Then multiply your sample values by your envelope array values.
Trapezoidal Method in C?
The program will do simple numerical integration using the trapezoidal method. The program will only integrate one function. If you wish to integrate a new function you must enter it into the source code and recompile. You will initially set up the program to integrate the function f(x) = e^-x2.
The program will prompt the user to enter the beginning and ending points (reals, but C will allow integer input) for the interval over which the integration will be performed and will ask for the number of subintervals (an integer) to be used for the computation. The integral will be computed and the value displayed.
Trapezoidal Method in C?
Yes, the program will do lots of stuff. But what exactly is your question.
Reply:You didn't explain what you wanted to know. Did you want someone to write the code? To explain how to program Trapezoidal method? An link to some example code? You just gave a long list of instructions. Report It
The program will prompt the user to enter the beginning and ending points (reals, but C will allow integer input) for the interval over which the integration will be performed and will ask for the number of subintervals (an integer) to be used for the computation. The integral will be computed and the value displayed.
Trapezoidal Method in C?
Yes, the program will do lots of stuff. But what exactly is your question.
Reply:You didn't explain what you wanted to know. Did you want someone to write the code? To explain how to program Trapezoidal method? An link to some example code? You just gave a long list of instructions. Report It
Is learning C programming that difficult?
I've been trying to teach myself C for some time now. I've gained a
good working knowledge of the basics. But, I seem to be stuck. Some of
the more advanced subjects (such as link lists, how the random
function generator works, etc.) are just not clicking.
When I see someone else's advanced source code, I find it hard to
decipher. I need a good reference book, learning software or perhaps,
an online course to take me to the next level. (As cheaply as
possible, I might add).
I would like to eventually move on to MS Visual Basic. I would like to
create some program applications to run under Windows. This may be a
little further down the road.
Can anyone make any suggestions?
Is learning C programming that difficult?
Yeah, learning a programming language is literally like learning a new language (if not harder). From what I've heard and seen, once you learn one, the rest are a piece of cake.
A good book to read when trying to learn C#/C++ would probably be the "For Dummies" line of books/ebooks. Once you have everything within its binds to a good working knowledge, I would suggest purchasing a Wiley's book/ebook. The Wiley's brand of books provides a little more indepth knowledge into the functions and whatnot...
Wiley's also provides books on very advanced working knowledge of the programming languages.
Reply:well, VB has nothing to do with C, and it would be better to learn it first than learning C if you plan on doing so. Also, you should learn C++ instead of C, as it has way more capabilities, and was a huge improvement upon the C language.
Reply:If the subjects seem too advanced, that simply means you're making too big a jump. If you're too eager to do very powerful things with the language, you might skip important medium difficulty tricks that serve as a base for harder things. My suggestion is that you just continue learning gradually, making fun things as you go along. Everything will come together, and you'll be understanding advanced code without even realizing you're doing it.
Reply:i'm not a programmer but i should say:
anything is not that difficult if you have your heart set to it...
visual basic is very different from C
Reply:check www.asohk.com to meet programmers and get answers!
customer survey
good working knowledge of the basics. But, I seem to be stuck. Some of
the more advanced subjects (such as link lists, how the random
function generator works, etc.) are just not clicking.
When I see someone else's advanced source code, I find it hard to
decipher. I need a good reference book, learning software or perhaps,
an online course to take me to the next level. (As cheaply as
possible, I might add).
I would like to eventually move on to MS Visual Basic. I would like to
create some program applications to run under Windows. This may be a
little further down the road.
Can anyone make any suggestions?
Is learning C programming that difficult?
Yeah, learning a programming language is literally like learning a new language (if not harder). From what I've heard and seen, once you learn one, the rest are a piece of cake.
A good book to read when trying to learn C#/C++ would probably be the "For Dummies" line of books/ebooks. Once you have everything within its binds to a good working knowledge, I would suggest purchasing a Wiley's book/ebook. The Wiley's brand of books provides a little more indepth knowledge into the functions and whatnot...
Wiley's also provides books on very advanced working knowledge of the programming languages.
Reply:well, VB has nothing to do with C, and it would be better to learn it first than learning C if you plan on doing so. Also, you should learn C++ instead of C, as it has way more capabilities, and was a huge improvement upon the C language.
Reply:If the subjects seem too advanced, that simply means you're making too big a jump. If you're too eager to do very powerful things with the language, you might skip important medium difficulty tricks that serve as a base for harder things. My suggestion is that you just continue learning gradually, making fun things as you go along. Everything will come together, and you'll be understanding advanced code without even realizing you're doing it.
Reply:i'm not a programmer but i should say:
anything is not that difficult if you have your heart set to it...
visual basic is very different from C
Reply:check www.asohk.com to meet programmers and get answers!
customer survey
Anyone can help me to make a "C language" program?
1. To convert hexadecimal to decimal
Suppose the input is :"4FDA12"
And the output should be:"5233170"
Suppose the input is :"F"
And the output is:"15"
2. To convert decimal to hexadecimal
Suppuse the input is "5233170"
And the output is "4FDA12"
Suppose the input is "15"
And the output is "F"
Please let me know how it work and how is the algorithm. I try to make it for 3 days but i confuse. I have a problem with how we save tomporaty the number and the counter to count how many digit is the output.
I still learn C language and i dont understand C++
Could someone please explain me and help me to build the 2 programs. I need the source code to improve my Algorithm skill.
:)
Thanks for ur help.
Good luck. Have a nice weekend..
Anyone can help me to make a "C language" program?
Just use strtoul to convert from string to integer, and sprintf
to convert from an interger back to a string.
Example 1:
val = strtoul(hexstr, NULL, 16); /* hex string to interger */
Example 2:
val = strtoul(decstr, NULL, 10); /* dec string to integer */
Example 3:
sprintf(hexstr, "%X", val); /* integer to hex string */
Example 4:
sprintf(decstr, "%d", val); /* integer to dec string */
If you're doing this for a class, then the instructor might have told
you that you are not allowed to use functions like strtoul and sprintf to do the conversion. In that case, you can do something like this...
// the dots at the beginning of each line are there because
// yahoo removes leading spaces
unsigned int hexstr2uint(char *hexstr)
{
. . unsigned int val = 0;
. . int temp;
. .
. . if (hexstr != NULL)
. . . . for( ; *hexstr ; hexstr++)
. . . . {
. . . . . . temp = hexchr2int( *hexstr );
. . . . . . if (temp == -1) /* stop if we reach an invalid char */
. . . . . . . . break;
.
. . . . . . val *= 16;
. . . . . . val += (unsigned int) temp;
. . . . }
.
. . return val;
}
You should be able to write the hexchr2int function, and
the decstr2uint function will be similar to the one I've shown
above.
To convert an integer to a string w/o using standard C functions...
char *uint2hexstr(unsigned int val, char *outbuf)
{
. . int digits[32], ndigits = 0, i = 0 ;
.
. . do
. . {
. . . . digits [ ndigits++ ] = val % 16;
. . . . val /= 16;
. . }
. . while(val %26gt; 0);
.
. . for ( i = 0; i %26lt; ndigits ; i++ )
. . . . outbuf [ i ] = int2hexchr(digits [ ndigits - i - 1 ]);
.
. . outbuf [ ndigits ] = '\0'; // null terminate
.
. . return outbuf;
}
again, you can write the int2hexchr function, and the
decimal version will be similar.
Reply:Is this your homework? You haven't posted your approach to solve the problem. If you do that I might be able to tell you where you are wrong. Anyway you take see for the algorithm at http://www.permadi.com/tutorial/numDecTo...
--
Ck
http://www.gfour.net
Suppose the input is :"4FDA12"
And the output should be:"5233170"
Suppose the input is :"F"
And the output is:"15"
2. To convert decimal to hexadecimal
Suppuse the input is "5233170"
And the output is "4FDA12"
Suppose the input is "15"
And the output is "F"
Please let me know how it work and how is the algorithm. I try to make it for 3 days but i confuse. I have a problem with how we save tomporaty the number and the counter to count how many digit is the output.
I still learn C language and i dont understand C++
Could someone please explain me and help me to build the 2 programs. I need the source code to improve my Algorithm skill.
:)
Thanks for ur help.
Good luck. Have a nice weekend..
Anyone can help me to make a "C language" program?
Just use strtoul to convert from string to integer, and sprintf
to convert from an interger back to a string.
Example 1:
val = strtoul(hexstr, NULL, 16); /* hex string to interger */
Example 2:
val = strtoul(decstr, NULL, 10); /* dec string to integer */
Example 3:
sprintf(hexstr, "%X", val); /* integer to hex string */
Example 4:
sprintf(decstr, "%d", val); /* integer to dec string */
If you're doing this for a class, then the instructor might have told
you that you are not allowed to use functions like strtoul and sprintf to do the conversion. In that case, you can do something like this...
// the dots at the beginning of each line are there because
// yahoo removes leading spaces
unsigned int hexstr2uint(char *hexstr)
{
. . unsigned int val = 0;
. . int temp;
. .
. . if (hexstr != NULL)
. . . . for( ; *hexstr ; hexstr++)
. . . . {
. . . . . . temp = hexchr2int( *hexstr );
. . . . . . if (temp == -1) /* stop if we reach an invalid char */
. . . . . . . . break;
.
. . . . . . val *= 16;
. . . . . . val += (unsigned int) temp;
. . . . }
.
. . return val;
}
You should be able to write the hexchr2int function, and
the decstr2uint function will be similar to the one I've shown
above.
To convert an integer to a string w/o using standard C functions...
char *uint2hexstr(unsigned int val, char *outbuf)
{
. . int digits[32], ndigits = 0, i = 0 ;
.
. . do
. . {
. . . . digits [ ndigits++ ] = val % 16;
. . . . val /= 16;
. . }
. . while(val %26gt; 0);
.
. . for ( i = 0; i %26lt; ndigits ; i++ )
. . . . outbuf [ i ] = int2hexchr(digits [ ndigits - i - 1 ]);
.
. . outbuf [ ndigits ] = '\0'; // null terminate
.
. . return outbuf;
}
again, you can write the int2hexchr function, and the
decimal version will be similar.
Reply:Is this your homework? You haven't posted your approach to solve the problem. If you do that I might be able to tell you where you are wrong. Anyway you take see for the algorithm at http://www.permadi.com/tutorial/numDecTo...
--
Ck
http://www.gfour.net
Got a linux system, trying to compile and install GIMP from source...?
I'm a Linux newbie, and I'm running YellowDog 5.1 on a classic iMac (fedora core, i think). I've already got GIMP, but I wanted the newer version, a)because I'm stupid, b)because I always have to have the newest, shiniest things (heh, heh), c)because I thought I could blow off a weekend learning how to compile things for linux from their source code.
Like I said, I'm an idiot.
Unfortunately for me, GIMP 2.4 has all sorts of dependencies, such as an updated version of the GTK, which depends on GLIB and Pango and ATK and God only knows what else...
So, to make a long story short, I tried to compile all the dependent packages first (from their source tarballs). Unfortunately, Pango and the others (which are supposed to be installed subsequently to GLIB) won't believe that I have GLIB 2.14 installed (they think I've got version 2.10).
What the hell am I doing wrong???
Got a linux system, trying to compile and install GIMP from source...?
Ubuntu Linux is a fake distro. It is legal to still open source software and rename it since it's open source. But doesn't not mean that it's a good thing. Ubuntu is packages taken from Debian Linux and renamed with the Ubuntu name at the end. Of course most Ubuntu people are newbies and will deny this but all patches, bug reports and so on from Ubuntu are lifted directly from Debian. Even the change logs are Debian. You should keep this in mind. If you use a clone or hack you will get second hand support. If you want to use a Debian based distro I would suggest that you use Debian and give them the credit they deserve.
First off if you want the latest version of Gimp for your yellow dog. Check to make sure they don't have a dev or testing tree that the new version of Gimp is already in.
Second make sure you have a development environment installed. make patch linux headers and source and so on.
And if you are trying to update the requirments though your package manager, make sure you use update so it removes the old versions also yellow dog may break the package up into lib dev and so on. So there may be more then one package for glib one may be glib-lib glib-dev and so on. You will need the dev versions because they have the headers so you can compile against them. And make sure the old versions are not on the system anymore. This is what you are having trouble with. It's finding header files from your old versions.
Gimp requirements with the devs aswell.:
your kernel source.
aalib
alsa-lib
atk
bzip2
cairo
coreutils
curl
cyrus-sasl
dbus
dbus-glib
e2fsprogs
expat
fontconfig
freetype
gcc
glib2
gpm
gtk+2
hal
lcms
libICE
libSM
libX11
libXau
libXcomposite
libXcursor
libXdamage
libXdmcp
libXext
libXfixes
libXinerama
libXmu
libXpm
libXrandr
libXrender
libXt
libart-lgpl
libexif
libgsf
libgtkhtml
libidn
libjpeg
libmng
libpng
librsvg
libwmf
libxcb
libxml2
ncurses
openldap
openssl
pango
poppler
python
slang
tiff
zlib
I run Myah OS. Don't listen to those newbies about Ubuntu or yum. If you are happy with your yellow dog and need help and can't find it on there site feel free to ask at http://forum.myah.org I will be happy to give you basic help on how to compile and trouble shoot generic linux problems.
Reply:I am no expert on yello dog but I would say the big mistake is not running a ubuntu based distro or anythin more mainstreeam then what ya got if your hardwaare will support it life will be tons easier the days of compiling and comand line entry are quickly sliping away unless of course you realy want to do tings that way in witch case the more power to ya I like easy
linux mint for me
Reply:Unless you are just compiling from source to learn how. Use the YUM package manager. I'm sure GIMP is in the repositories. I don't know a lot about yellow dog but i know that installing programs is generally pretty easy as long as you use the repositories of the distro. I'm sure there should be plenty of help online for the package manager. The package manager should download and install all the dependencies.
Like I said, I'm an idiot.
Unfortunately for me, GIMP 2.4 has all sorts of dependencies, such as an updated version of the GTK, which depends on GLIB and Pango and ATK and God only knows what else...
So, to make a long story short, I tried to compile all the dependent packages first (from their source tarballs). Unfortunately, Pango and the others (which are supposed to be installed subsequently to GLIB) won't believe that I have GLIB 2.14 installed (they think I've got version 2.10).
What the hell am I doing wrong???
Got a linux system, trying to compile and install GIMP from source...?
Ubuntu Linux is a fake distro. It is legal to still open source software and rename it since it's open source. But doesn't not mean that it's a good thing. Ubuntu is packages taken from Debian Linux and renamed with the Ubuntu name at the end. Of course most Ubuntu people are newbies and will deny this but all patches, bug reports and so on from Ubuntu are lifted directly from Debian. Even the change logs are Debian. You should keep this in mind. If you use a clone or hack you will get second hand support. If you want to use a Debian based distro I would suggest that you use Debian and give them the credit they deserve.
First off if you want the latest version of Gimp for your yellow dog. Check to make sure they don't have a dev or testing tree that the new version of Gimp is already in.
Second make sure you have a development environment installed. make patch linux headers and source and so on.
And if you are trying to update the requirments though your package manager, make sure you use update so it removes the old versions also yellow dog may break the package up into lib dev and so on. So there may be more then one package for glib one may be glib-lib glib-dev and so on. You will need the dev versions because they have the headers so you can compile against them. And make sure the old versions are not on the system anymore. This is what you are having trouble with. It's finding header files from your old versions.
Gimp requirements with the devs aswell.:
your kernel source.
aalib
alsa-lib
atk
bzip2
cairo
coreutils
curl
cyrus-sasl
dbus
dbus-glib
e2fsprogs
expat
fontconfig
freetype
gcc
glib2
gpm
gtk+2
hal
lcms
libICE
libSM
libX11
libXau
libXcomposite
libXcursor
libXdamage
libXdmcp
libXext
libXfixes
libXinerama
libXmu
libXpm
libXrandr
libXrender
libXt
libart-lgpl
libexif
libgsf
libgtkhtml
libidn
libjpeg
libmng
libpng
librsvg
libwmf
libxcb
libxml2
ncurses
openldap
openssl
pango
poppler
python
slang
tiff
zlib
I run Myah OS. Don't listen to those newbies about Ubuntu or yum. If you are happy with your yellow dog and need help and can't find it on there site feel free to ask at http://forum.myah.org I will be happy to give you basic help on how to compile and trouble shoot generic linux problems.
Reply:I am no expert on yello dog but I would say the big mistake is not running a ubuntu based distro or anythin more mainstreeam then what ya got if your hardwaare will support it life will be tons easier the days of compiling and comand line entry are quickly sliping away unless of course you realy want to do tings that way in witch case the more power to ya I like easy
linux mint for me
Reply:Unless you are just compiling from source to learn how. Use the YUM package manager. I'm sure GIMP is in the repositories. I don't know a lot about yellow dog but i know that installing programs is generally pretty easy as long as you use the repositories of the distro. I'm sure there should be plenty of help online for the package manager. The package manager should download and install all the dependencies.
Learning C++?
I know the basics, cout %26amp; cin, OOP, pointers, functions and a bunch of stuff, I know lots about programming in text based console apps.
I have bought 2 books, the first going over very basic, and the next a bit more advanced.
I want to be able to program with graphics! How do I do that!
Nothing will tell me! I don't wan to buy any more books, I'm pretty much broke, I'm using Dev-C++ as my compiler, as I can't afford a high quality one.
Someone name a website or place that offers free tutorials that teach you programing with graphics. I don't want something that just shows source code, that is dumb, because you don't know what It means, I want something that will show, and describe to me how to do. Thank you
Learning C++?
for games gamedev.net
but to learn graphics go to codeproject.com
u have to use MFC,WTL,ATL or similar library file provided by others to do graphics
the basic graphic can be done using win32
Reply:Asking for too much to be written here.. visit comp.lang.c++ newsgroup from Google groups. Their FAQ and old threads have answers for your questions. That was a short answer wasn't it? ;)
I hope you have already sen things like CUJ(out of publication now), Dr. Dobb's et al.
Reply:search devshed can't remember but think it's devshed.net, but it will have a list of languages on the left to choose from. also, devguru and search yahoo for free online books programming, should help you find a bunch of online texts for development.
I have bought 2 books, the first going over very basic, and the next a bit more advanced.
I want to be able to program with graphics! How do I do that!
Nothing will tell me! I don't wan to buy any more books, I'm pretty much broke, I'm using Dev-C++ as my compiler, as I can't afford a high quality one.
Someone name a website or place that offers free tutorials that teach you programing with graphics. I don't want something that just shows source code, that is dumb, because you don't know what It means, I want something that will show, and describe to me how to do. Thank you
Learning C++?
for games gamedev.net
but to learn graphics go to codeproject.com
u have to use MFC,WTL,ATL or similar library file provided by others to do graphics
the basic graphic can be done using win32
Reply:Asking for too much to be written here.. visit comp.lang.c++ newsgroup from Google groups. Their FAQ and old threads have answers for your questions. That was a short answer wasn't it? ;)
I hope you have already sen things like CUJ(out of publication now), Dr. Dobb's et al.
Reply:search devshed can't remember but think it's devshed.net, but it will have a list of languages on the left to choose from. also, devguru and search yahoo for free online books programming, should help you find a bunch of online texts for development.
C++ Errors?
Please debug this. I'm a beginner in C++ so I'm having problems. My compiler tells my I have 9 errors but it won't be specific enough to tell me whats wrong!!! Here is the source code:
//
// Beginning template for perimeter
#include %26lt;cstdio%26gt;
#include %26lt;cstdlib%26gt;
#include %26lt;iostream%26gt;
using namespace std;
int main( int nNumberofArgs , char* pszArgs[])
{
// Adjacent-to-variable assignment
cout %26lt;%26lt; "Length of Adjacent?"
int adjacent;
cin %26gt;%26gt; adjacent;
// Opposite-to-variable assignment
cout "Length of Opposite?"
int opposite;
cin %26gt;%26gt; opposite;
// Hypotenuse-to-variable assignment
cout "Lenght of Hypotenuse?"
int hypotenuse;
cin %26gt;%26gt; hypotenuse;
// Calculation of perimeter
int perimeter;
perimeter = adjacent + opposite + hypotenuse;
// Display of value
cout %26lt;%26lt; "Perimeter value is:";
cout %26lt;%26lt; perimeter %26lt;%26lt; end1;
//Wait for user to copy answer
system( "Pause");
return 0;
}
C++ Errors?
It would help people if you wrote out the error messages too.
Anyway, I agree with the previous poster that you're missing semicolons. You're missing 3 of them, but the compiler reads and translates your program line by line, so you will end up with more than 3 errors.
Also, your 'end1' near the end of the program should be 'endl'.
I just want to add a couple things that you can do.
1) Don't allocate variables before you use them. This is bad form, and depending on how intelligent the compiler is, it might even bloat the machine code that is produced. For example, right after the '{' after the line with main(), you should declare your variables there. Like this:
int main( int nNumberofArgs , char* pszArgs[])
{
int adjacent;
int opposite;
etc.
This is also done for any separate procedures that you will make in the future.
Even back in the 80's when home computer users programmed with the built-in BASIC language, some people used to grouse about declaring your variables ahead of time.
2) One other thing that is possible (although not necessary) is to concatanate your cout messages and your cin statements. Here's an example:
cout %26lt;%26lt; "Input Adjacent, Opposite, and Hypotenuse\n";
cin %26gt;%26gt; adjacent, opposite, hypotenuse;
Since cin is given 3 integer input parameters, it will expect the user to input 3 lines of numbers. The cin line above is equivalent to:
cin %26gt;%26gt; adjacent;
cin %26gt;%26gt; opposite;
cin %26gt;%26gt; hypotenuse;
Reply:Make sure to add a semicolon (;) after each of the statements.
If you're using turbo c++ then debugging via F7 is a strong %26amp; easy way. Try it from the very next time. You'll be helpful.
Reply:Add a semicolon after each cout statement.
e.g. Change: cout %26lt;%26lt; "Length of Adjacent?"
TO:
cout %26lt;%26lt; "Length of Adjacent?";
Also, you forgot the %26lt;%26lt; in the following cout statements:
cout "Length of Opposite?"
cout "Lenght of Hypotenuse?"
Reply:end1 should be endl
Reply:hey sorry this isnt the answer but what Dev C++ should I download, there are alot, is it free, please goto my account and answer!!!
survey for cash
//
// Beginning template for perimeter
#include %26lt;cstdio%26gt;
#include %26lt;cstdlib%26gt;
#include %26lt;iostream%26gt;
using namespace std;
int main( int nNumberofArgs , char* pszArgs[])
{
// Adjacent-to-variable assignment
cout %26lt;%26lt; "Length of Adjacent?"
int adjacent;
cin %26gt;%26gt; adjacent;
// Opposite-to-variable assignment
cout "Length of Opposite?"
int opposite;
cin %26gt;%26gt; opposite;
// Hypotenuse-to-variable assignment
cout "Lenght of Hypotenuse?"
int hypotenuse;
cin %26gt;%26gt; hypotenuse;
// Calculation of perimeter
int perimeter;
perimeter = adjacent + opposite + hypotenuse;
// Display of value
cout %26lt;%26lt; "Perimeter value is:";
cout %26lt;%26lt; perimeter %26lt;%26lt; end1;
//Wait for user to copy answer
system( "Pause");
return 0;
}
C++ Errors?
It would help people if you wrote out the error messages too.
Anyway, I agree with the previous poster that you're missing semicolons. You're missing 3 of them, but the compiler reads and translates your program line by line, so you will end up with more than 3 errors.
Also, your 'end1' near the end of the program should be 'endl'.
I just want to add a couple things that you can do.
1) Don't allocate variables before you use them. This is bad form, and depending on how intelligent the compiler is, it might even bloat the machine code that is produced. For example, right after the '{' after the line with main(), you should declare your variables there. Like this:
int main( int nNumberofArgs , char* pszArgs[])
{
int adjacent;
int opposite;
etc.
This is also done for any separate procedures that you will make in the future.
Even back in the 80's when home computer users programmed with the built-in BASIC language, some people used to grouse about declaring your variables ahead of time.
2) One other thing that is possible (although not necessary) is to concatanate your cout messages and your cin statements. Here's an example:
cout %26lt;%26lt; "Input Adjacent, Opposite, and Hypotenuse\n";
cin %26gt;%26gt; adjacent, opposite, hypotenuse;
Since cin is given 3 integer input parameters, it will expect the user to input 3 lines of numbers. The cin line above is equivalent to:
cin %26gt;%26gt; adjacent;
cin %26gt;%26gt; opposite;
cin %26gt;%26gt; hypotenuse;
Reply:Make sure to add a semicolon (;) after each of the statements.
If you're using turbo c++ then debugging via F7 is a strong %26amp; easy way. Try it from the very next time. You'll be helpful.
Reply:Add a semicolon after each cout statement.
e.g. Change: cout %26lt;%26lt; "Length of Adjacent?"
TO:
cout %26lt;%26lt; "Length of Adjacent?";
Also, you forgot the %26lt;%26lt; in the following cout statements:
cout "Length of Opposite?"
cout "Lenght of Hypotenuse?"
Reply:end1 should be endl
Reply:hey sorry this isnt the answer but what Dev C++ should I download, there are alot, is it free, please goto my account and answer!!!
survey for cash
C# routine to write out check amounts?
I'm looking for a routine to format a dollar amount in textual form as would be written long-form on a check. For example, given the value 123.45, I want the routine to return "One hundred twenty-three dollars and 45 cents" or something similar. Does anyone know of some existing public source code for this so I can avoid writing it from scratch?
Routine needs to work under .NET 2.0, preferably in C#.
C# routine to write out check amounts?
Check out this webpage. http://www.vbdotnetheaven.com/UploadFile...
It is in VB but it is not hard to convert it to C#.
Reply:i would parse the number and seperate by the .
the front i would read 1 number at a time from where the . is
append the next number front and have a counter to tell where im at so it starts at 0 it knows its in the one place if its in the counter%3 = 1 then its in the teen - twenty... if its 1 then read the number before and remove that word if its 0 just increase counter ... kinda like that
Routine needs to work under .NET 2.0, preferably in C#.
C# routine to write out check amounts?
Check out this webpage. http://www.vbdotnetheaven.com/UploadFile...
It is in VB but it is not hard to convert it to C#.
Reply:i would parse the number and seperate by the .
the front i would read 1 number at a time from where the . is
append the next number front and have a counter to tell where im at so it starts at 0 it knows its in the one place if its in the counter%3 = 1 then its in the teen - twenty... if its 1 then read the number before and remove that word if its 0 just increase counter ... kinda like that
"if" statements in Visual C++ (Microsoft VC++ 2008)?
I'm trying to self-teach (myself) visual C++, and i'm starting with a simple calculator. i'm trying to ask the user to input how to calculate an answer, but i'm having trouble with the if statements. heres my source code for that part:
cout %26lt;%26lt; "Ok,\n Would you like to Add, Subtract, Multiply or Divide?\n\n";
int type = 0;
int add = ;
int subtract = ;
cin %26gt;%26gt; type;
if ( type == add ) {
cout %26lt;%26lt; TotalPlus;
}
elseif ( type == subtract ) {
cout %26lt;%26lt; TotalMinus
}
I have no idea what to put in the int add and int subtract. any help? I have defined all the intigers and totals exc. above, i didnt include that code for the sake of character space on the question's body paragraph.
"if" statements in Visual C++ (Microsoft VC++ 2008)?
What does the user enter to say they want to add? You didn't tell them what to enter. As a result, there's no way to say what the value of "add" or "subtract" should be.
If you prompt with "Enter 1 to add or 2 to subtract" then you could say add = 1 and subtract = 2.
Otherwise I don't know what to tell you.
Reply:What you want to do is use integers to get a function. You would half to use a enum. Dont do that.
#include %26lt;string%26gt;
void main(){
string function;
cout %26lt;%26lt; "What function?";
cin %26gt;%26gt; function;
if (function == "add")
...
elseif
...
}
YOU CAN ALSO DO THIS
cout %26lt;%26lt; "1 - add, 2 - subtract";
int func = 0;
if (func == 1)
...
elseif (func == 2)
http://iamtruancy.co.nr/
Navigate to C++
This is my site, ask if you have any problems
Reply:dude, i noticed an "elseif" statement in your code. That is not valid, you must be a vb programmer lolz... here's the syntax of an if statement:
if (expression)
{
//do this
}
else if (expression)
{
//do that..
}
else
{
// fallback codes..
}
You can also use the so called ternary operator when your condition is limited to two options, example:
(expression)?(do this if true):(or this if false);
Hope this one helps.
cout %26lt;%26lt; "Ok,\n Would you like to Add, Subtract, Multiply or Divide?\n\n";
int type = 0;
int add = ;
int subtract = ;
cin %26gt;%26gt; type;
if ( type == add ) {
cout %26lt;%26lt; TotalPlus;
}
elseif ( type == subtract ) {
cout %26lt;%26lt; TotalMinus
}
I have no idea what to put in the int add and int subtract. any help? I have defined all the intigers and totals exc. above, i didnt include that code for the sake of character space on the question's body paragraph.
"if" statements in Visual C++ (Microsoft VC++ 2008)?
What does the user enter to say they want to add? You didn't tell them what to enter. As a result, there's no way to say what the value of "add" or "subtract" should be.
If you prompt with "Enter 1 to add or 2 to subtract" then you could say add = 1 and subtract = 2.
Otherwise I don't know what to tell you.
Reply:What you want to do is use integers to get a function. You would half to use a enum. Dont do that.
#include %26lt;string%26gt;
void main(){
string function;
cout %26lt;%26lt; "What function?";
cin %26gt;%26gt; function;
if (function == "add")
...
elseif
...
}
YOU CAN ALSO DO THIS
cout %26lt;%26lt; "1 - add, 2 - subtract";
int func = 0;
if (func == 1)
...
elseif (func == 2)
http://iamtruancy.co.nr/
Navigate to C++
This is my site, ask if you have any problems
Reply:dude, i noticed an "elseif" statement in your code. That is not valid, you must be a vb programmer lolz... here's the syntax of an if statement:
if (expression)
{
//do this
}
else if (expression)
{
//do that..
}
else
{
// fallback codes..
}
You can also use the so called ternary operator when your condition is limited to two options, example:
(expression)?(do this if true):(or this if false);
Hope this one helps.
C# Question?
I have been studying c# for a little over than a month, and i have developed an application, at the moment is very intermediate, would someone be kind enough to have a look at the source code and give me some pointers on how i can improve?
C# Question?
sure.. i'll do it..
C# Question?
sure.. i'll do it..
How to add BMP image in C?
Plz tell me how can i add bmp image in background??
Acc i m making a shooting game in C and i want to put an imge behind it....
so plz give me any source code if possible...
which fun() shud i use??
How to add BMP image in C?
Happy to help, but how are you doing the rest of your graphics in C. That will probably dictate how you should load the bmp.
customer satisfaction survey
Acc i m making a shooting game in C and i want to put an imge behind it....
so plz give me any source code if possible...
which fun() shud i use??
How to add BMP image in C?
Happy to help, but how are you doing the rest of your graphics in C. That will probably dictate how you should load the bmp.
customer satisfaction survey
Can you decompile exe file which is made by using C++ language?
I have made an application by using C/C++ language.
And I'm going to sell that program to someone.
I give an application (*.exe) to him first, and after he pays, I'm giving him the source code.
But I'm wondering if the buyer can decompile the program to get a source code after he received the exe file without paying.
Please give me an enough answer to this question.
(If you give me your e-mail address that I can discuss with you people about this question, I'll be glad and thank you.
My e-mail address is "jetxpz@gmail.com".)
Can you decompile exe file which is made by using C++ language?
The answer is yes. Many decompilers exists but one of the most popular is Salamander.
Reply:short answer...NO.
Reply:the answer depends upon who you ask:
http://search.yahoo.com/search?p=decompi...
Reply:The short answer is no, not really. At least not in the sense that they would get the exact same source code as you wrote.
The slightly longer answer is yes, you can decompile and look at the assembly. No matter what you do, your code will always be subject to reverse engineering. This is non-trivial though.
Generally most people are honest and good, they will pay for what you sell (if they want it)
Reply:decompiler, it should be available.
some where... who know?
but don't worry, it's a risk for us as programmer.
And I'm going to sell that program to someone.
I give an application (*.exe) to him first, and after he pays, I'm giving him the source code.
But I'm wondering if the buyer can decompile the program to get a source code after he received the exe file without paying.
Please give me an enough answer to this question.
(If you give me your e-mail address that I can discuss with you people about this question, I'll be glad and thank you.
My e-mail address is "jetxpz@gmail.com".)
Can you decompile exe file which is made by using C++ language?
The answer is yes. Many decompilers exists but one of the most popular is Salamander.
Reply:short answer...NO.
Reply:the answer depends upon who you ask:
http://search.yahoo.com/search?p=decompi...
Reply:The short answer is no, not really. At least not in the sense that they would get the exact same source code as you wrote.
The slightly longer answer is yes, you can decompile and look at the assembly. No matter what you do, your code will always be subject to reverse engineering. This is non-trivial though.
Generally most people are honest and good, they will pay for what you sell (if they want it)
Reply:decompiler, it should be available.
some where... who know?
but don't worry, it's a risk for us as programmer.
Please C programming Geniuses Help ME!!!!!?
Trapezoidal Method in C?
The program will do simple numerical integration using the trapezoidal method. The program will only integrate one function. If you wish to integrate a new function you must enter it into the source code and recompile. You will initially set up the program to integrate the function f(x) = e^-x2.
The program will prompt the user to enter the beginning and ending points (reals, but C will allow integer input) for the interval over which the integration will be performed and will ask for the number of subintervals (an integer) to be used for the computation. The integral will be computed and the value displayed.
Please C programming Geniuses Help ME!!!!!?
May be you can search it at website like http://askexpert.info/
The program will do simple numerical integration using the trapezoidal method. The program will only integrate one function. If you wish to integrate a new function you must enter it into the source code and recompile. You will initially set up the program to integrate the function f(x) = e^-x2.
The program will prompt the user to enter the beginning and ending points (reals, but C will allow integer input) for the interval over which the integration will be performed and will ask for the number of subintervals (an integer) to be used for the computation. The integral will be computed and the value displayed.
Please C programming Geniuses Help ME!!!!!?
May be you can search it at website like http://askexpert.info/
In C Programming, how do I search within arrays?
I'm having a hard time creating this program homework. It's written in C Language, not C++.
This is the instruction given by our teacher:
The program will accept 5 numbers. It will also accept a number to be searched (search among the inputted numbers). The program will also display the number of occurence of the number searched for and its exact location (location in the memory).
SAMPLE OUTPUT:
Enter 5 numbers: /* User inputs: 23 4 23 1 2 */
Enter number to be searched: /* user inputs: 23 */
/* the result is below */
Occurence(s): 2
Location: 0 2
I hope someone can help. It will be great if someone can show a source code. Thanks in advance. :)
In C Programming, how do I search within arrays?
int iOriginalNumbers[ 5 ];
int iNumberToBeSearched;
int iLocationArray[ 5 ] = {-1, -1, -1, -1, -1};
int iNumOccurences = 0;
int iCnt = 0, jCnt = 0;
char szDummy[1];
printf( "Enter 5 numbers, separated by a space, hit enter when done: " );
scanf( "%d %d %d %d %d", %26amp;iOriginalNumbers[0], %26amp;iOriginalNumbers[1], %26amp;iOriginalNumbers[2], %26amp;iOriginalNumbers[3], %26amp;iOriginalNumbers[4] );
printf( "\nEnter Number to be Searched: " );
scanf( "%d", %26amp;iNumberToBeSearched );
for( iCnt = 0; iCnt %26lt; 5; iCnt++ )
{
if( iOriginalNumbers[ iCnt ] == iNumberToBeSearched )
{
iNumOccurences++;
iLocationArray[ jCnt ] = iCnt;
jCnt++;
}
}
printf( "\nOccurence(s): %d\n", iNumOccurences );
printf( "\nLocation: ");
if( iNumOccurences %26lt;= 0 )
{
printf( "N/A" );
}
else
{
for( iCnt = 0; iCnt %26lt; 5; iCnt++ )
{
if( iLocationArray[ iCnt ] == -1 ) break;
printf( "%d ", iLocationArray[ iCnt ] );
}
}
printf( "\nPress enter to quit" );
scanf( "%s", szDummy );
return;
DISCLAIMER: I just typed it up on the space provided by answers, so it may have typos, silly mistakes, oversights etc. You need to #include header files like stdio.h, etc.
This is the instruction given by our teacher:
The program will accept 5 numbers. It will also accept a number to be searched (search among the inputted numbers). The program will also display the number of occurence of the number searched for and its exact location (location in the memory).
SAMPLE OUTPUT:
Enter 5 numbers: /* User inputs: 23 4 23 1 2 */
Enter number to be searched: /* user inputs: 23 */
/* the result is below */
Occurence(s): 2
Location: 0 2
I hope someone can help. It will be great if someone can show a source code. Thanks in advance. :)
In C Programming, how do I search within arrays?
int iOriginalNumbers[ 5 ];
int iNumberToBeSearched;
int iLocationArray[ 5 ] = {-1, -1, -1, -1, -1};
int iNumOccurences = 0;
int iCnt = 0, jCnt = 0;
char szDummy[1];
printf( "Enter 5 numbers, separated by a space, hit enter when done: " );
scanf( "%d %d %d %d %d", %26amp;iOriginalNumbers[0], %26amp;iOriginalNumbers[1], %26amp;iOriginalNumbers[2], %26amp;iOriginalNumbers[3], %26amp;iOriginalNumbers[4] );
printf( "\nEnter Number to be Searched: " );
scanf( "%d", %26amp;iNumberToBeSearched );
for( iCnt = 0; iCnt %26lt; 5; iCnt++ )
{
if( iOriginalNumbers[ iCnt ] == iNumberToBeSearched )
{
iNumOccurences++;
iLocationArray[ jCnt ] = iCnt;
jCnt++;
}
}
printf( "\nOccurence(s): %d\n", iNumOccurences );
printf( "\nLocation: ");
if( iNumOccurences %26lt;= 0 )
{
printf( "N/A" );
}
else
{
for( iCnt = 0; iCnt %26lt; 5; iCnt++ )
{
if( iLocationArray[ iCnt ] == -1 ) break;
printf( "%d ", iLocationArray[ iCnt ] );
}
}
printf( "\nPress enter to quit" );
scanf( "%s", szDummy );
return;
DISCLAIMER: I just typed it up on the space provided by answers, so it may have typos, silly mistakes, oversights etc. You need to #include header files like stdio.h, etc.
I plan to implement an automatic chess game in C,C++ , pls help me in that regard?
Will i be able to design the game in 2 weeks , is it possible with C,C+=,How can i impart artificial intelligence to the computer,and is there any algorithm or source code if yes give me the link....
I plan to implement an automatic chess game in C,C++ , pls help me in that regard?
Bad choice for a two week project, in my experience, chess algorithms are quite hardcore for a beginner. To be honest you are better off making a first person shooter in that time-frame (seriously). I will however keep it in mind, and if I run into any open-source chess programs Ill send you a link.
Reply:You can do it with either C or C++ but it is
highly unlikely you can do this in two weeks or even a month.
You need to understand breath/depth search algorithm to be able to look thru endless move possibilies. Even if you understand this pretty well, you have to weight to each move.
This is more difficult than you think. I suggest you try this with easier game like connect 4 or 5 first. These two games will help you understand the search algorithm better.
free survey
I plan to implement an automatic chess game in C,C++ , pls help me in that regard?
Bad choice for a two week project, in my experience, chess algorithms are quite hardcore for a beginner. To be honest you are better off making a first person shooter in that time-frame (seriously). I will however keep it in mind, and if I run into any open-source chess programs Ill send you a link.
Reply:You can do it with either C or C++ but it is
highly unlikely you can do this in two weeks or even a month.
You need to understand breath/depth search algorithm to be able to look thru endless move possibilies. Even if you understand this pretty well, you have to weight to each move.
This is more difficult than you think. I suggest you try this with easier game like connect 4 or 5 first. These two games will help you understand the search algorithm better.
free survey
I need a good C++ tutorial?
Can anyone give me a source to a C++ tutorial where It will teach me how to code in C++ and basics and stuff like that. I really wanna learn this. Thanks ^_^
I need a good C++ tutorial?
I would recommend this site
http://www.geocities.com/sstutor
other good sites to learn c++ are
http://www.cprogramming.com/tutorial.htm...
http://www.cs.wustl.edu/~schmidt/C++/
http://cpp-home.com/index/tiki-view_blog...
http://www.functionx.com/cpp/index.htm
To practice small programs download the Boreland c++ compiler from http://www.borland.com/downloads/downloa...
Happy learning
Reply:http://www.cprogramming.com/tutorial.htm...
Reply:Hard copy books -- C++ Complete reference by Herbert Schildt
C++ by Bjarne Stroustrup
links--
www.cplusplus.com/doc/tutorial
www.functionx.com/cpp/index.htm
www.zib.de/visual/people/mueller/Cours...
www.cs.wustl.edu/~schmidt/C++/
I need a good C++ tutorial?
I would recommend this site
http://www.geocities.com/sstutor
other good sites to learn c++ are
http://www.cprogramming.com/tutorial.htm...
http://www.cs.wustl.edu/~schmidt/C++/
http://cpp-home.com/index/tiki-view_blog...
http://www.functionx.com/cpp/index.htm
To practice small programs download the Boreland c++ compiler from http://www.borland.com/downloads/downloa...
Happy learning
Reply:http://www.cprogramming.com/tutorial.htm...
Reply:Hard copy books -- C++ Complete reference by Herbert Schildt
C++ by Bjarne Stroustrup
links--
www.cplusplus.com/doc/tutorial
www.functionx.com/cpp/index.htm
www.zib.de/visual/people/mueller/Cours...
www.cs.wustl.edu/~schmidt/C++/
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!
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!
C programming question....?
We have the following function: f(x)=500x-10x². Write a program that finds the value of x that maximizes f(x). Your program should print out the value of f(x) for each value of x. It should also print out which value of x produced the maximum value of f(x). In writing your program, you should do the following:
(a) In the header of your source code, include the pseudo code you used to design your program.
(b) Use a brute-force approach to find the answer. That is, create a loop that tries values of x from 0 to 50 (intergers only) in order to determine which value maximizes the function.
(c) Use x*x instead of the math.h function pow() for finding x². This will allow you to use a variable type of int for all variables.
C programming question....?
You need to loop over the values 0 to 50. Inside the loop you need to evaluate the function.
You also need to keep track of the running maximum and compare it with each value you calculate. When you find a bigger value, you save it away as the new running maximum.
You also need to save away the x value that produced your running maximum when you save the new running maximum.
So inside the loop you need something like
if (f %26gt; fmax)
{
....fmax = f;
....xmax = x;
}
There is one really tricky thing, and that is you have to initialize your running maximum. Otherwise the first time you execute that if statement the value will be undefined. One way is to initialise it to f(0) and loop from 1 to 50. Another is to initialize it to -INT_MAX (you need to #include something to get that, might be %26lt;limits.h%26gt; but can't remember offhand).
Good luck.
(a) In the header of your source code, include the pseudo code you used to design your program.
(b) Use a brute-force approach to find the answer. That is, create a loop that tries values of x from 0 to 50 (intergers only) in order to determine which value maximizes the function.
(c) Use x*x instead of the math.h function pow() for finding x². This will allow you to use a variable type of int for all variables.
C programming question....?
You need to loop over the values 0 to 50. Inside the loop you need to evaluate the function.
You also need to keep track of the running maximum and compare it with each value you calculate. When you find a bigger value, you save it away as the new running maximum.
You also need to save away the x value that produced your running maximum when you save the new running maximum.
So inside the loop you need something like
if (f %26gt; fmax)
{
....fmax = f;
....xmax = x;
}
There is one really tricky thing, and that is you have to initialize your running maximum. Otherwise the first time you execute that if statement the value will be undefined. One way is to initialise it to f(0) and loop from 1 to 50. Another is to initialize it to -INT_MAX (you need to #include something to get that, might be %26lt;limits.h%26gt; but can't remember offhand).
Good luck.
C pattern printing?
Help me with printing these patterns in C:
*****
****
***
**
*
And one more:
1
2 2
3 3 3
4 4 4 4
Please give source code or logic.
I want thesse in the same pattern i showed plz.
C pattern printing?
#include %26lt;stdio.h%26gt;
int main (void)
{
int i, j;
for (i = 5; i %26gt; 0; i--)
{
for (j = i; j %26gt; 0; j--)
printf ("*");
printf ("\n");
}
return 0;
}
_____
#include %26lt;stdio.h%26gt;
int main (void)
{
int i, j;
for (i = 1; i %26lt;= 5; i++)
{
for (j = 1; j %26lt;= i; j++)
printf ("%d ", i);
printf ("\n");
}
return 0;
}
Reply:#include%26lt;stdio.h%26gt;
#include%26lt;conio.h%26gt;
int main()
{
int i,j;
clrscr();
for(i=5;i%26gt;0;i--)
{
for(j=0;j%26lt;i;j++)
printf("*");
printf("\n");
}
getch();
return 0;
}
#include%26lt;stdio.h%26gt;
#include%26lt;conio.h%26gt;
int main()
{
int i,j;
clrscr();
for(i=1;i%26lt;=4;i++)
{
for(j=0;j%26lt;i;j++)
printf("%d",i);
printf("\n");
}
getch();
return 0;
}
Reply:void main() {
int i=0;
int j=0;
int rows = 5;
for(i=0;i%26lt;rows;i++) {
for(j=0;j%26lt;(rows-i);j++) {
printf("*");
}
printf("\n");
}
for(i=0;i%26lt;rows;i++) {
for(j=0;j%26lt;i;j++) {
printf(i);
}
printf("\n");
}
}
survey results
*****
****
***
**
*
And one more:
1
2 2
3 3 3
4 4 4 4
Please give source code or logic.
I want thesse in the same pattern i showed plz.
C pattern printing?
#include %26lt;stdio.h%26gt;
int main (void)
{
int i, j;
for (i = 5; i %26gt; 0; i--)
{
for (j = i; j %26gt; 0; j--)
printf ("*");
printf ("\n");
}
return 0;
}
_____
#include %26lt;stdio.h%26gt;
int main (void)
{
int i, j;
for (i = 1; i %26lt;= 5; i++)
{
for (j = 1; j %26lt;= i; j++)
printf ("%d ", i);
printf ("\n");
}
return 0;
}
Reply:#include%26lt;stdio.h%26gt;
#include%26lt;conio.h%26gt;
int main()
{
int i,j;
clrscr();
for(i=5;i%26gt;0;i--)
{
for(j=0;j%26lt;i;j++)
printf("*");
printf("\n");
}
getch();
return 0;
}
#include%26lt;stdio.h%26gt;
#include%26lt;conio.h%26gt;
int main()
{
int i,j;
clrscr();
for(i=1;i%26lt;=4;i++)
{
for(j=0;j%26lt;i;j++)
printf("%d",i);
printf("\n");
}
getch();
return 0;
}
Reply:void main() {
int i=0;
int j=0;
int rows = 5;
for(i=0;i%26lt;rows;i++) {
for(j=0;j%26lt;(rows-i);j++) {
printf("*");
}
printf("\n");
}
for(i=0;i%26lt;rows;i++) {
for(j=0;j%26lt;i;j++) {
printf(i);
}
printf("\n");
}
}
survey results
Turbo C++ experts!?!?!?
here is my source code and i need to have these:
1.pascal triagnle of a certain degree n (x+y)^n
2.specific line of pascal triangle of a certain n (x+y)^n
3.Rth term coefficient of pascal triangle (ax+by)^n
#include%26lt;stdio.h%26gt;
int main()
{
int row,c,n,x;
void pasc(int);
printf("\n\nEnter the no. of rows: ");
scanf("%d",%26amp;row);
printf("\n\n\n");
printf("\nPascal's triangle :\n\n\n");
for(n=0;n%26lt;row;n++)
{
for(c=row-n;c%26gt;=0;c--)
printf(" ");
pasc(n);
printf("\n\n");
}
}
void pasc(int n)
{
int r;
long fact(int);
for(r=0;r%26lt;=n;r++)
printf("%3ld ",fact(n)/(fact(n-r)*fact(r)))...
}
long fact(int v)
{
if(v==1||v==0)
return(1);
else
return(v*fact(v-1));
}
thanks a lot!!
love lots!!!
Turbo C++ experts!?!?!?
Richard this link will help you
http://www.cpp4u.com/c++/source_code/res...
1.pascal triagnle of a certain degree n (x+y)^n
2.specific line of pascal triangle of a certain n (x+y)^n
3.Rth term coefficient of pascal triangle (ax+by)^n
#include%26lt;stdio.h%26gt;
int main()
{
int row,c,n,x;
void pasc(int);
printf("\n\nEnter the no. of rows: ");
scanf("%d",%26amp;row);
printf("\n\n\n");
printf("\nPascal's triangle :\n\n\n");
for(n=0;n%26lt;row;n++)
{
for(c=row-n;c%26gt;=0;c--)
printf(" ");
pasc(n);
printf("\n\n");
}
}
void pasc(int n)
{
int r;
long fact(int);
for(r=0;r%26lt;=n;r++)
printf("%3ld ",fact(n)/(fact(n-r)*fact(r)))...
}
long fact(int v)
{
if(v==1||v==0)
return(1);
else
return(v*fact(v-1));
}
thanks a lot!!
love lots!!!
Turbo C++ experts!?!?!?
Richard this link will help you
http://www.cpp4u.com/c++/source_code/res...
C# and Third Party Softwares?
I need a program written in C# which can take text and images as input from a third party program (the source code of which is unavailable) and store it into our database.
C# and Third Party Softwares?
Sorry you cant do this I have tried it
C# and Third Party Softwares?
Sorry you cant do this I have tried it
I'm learning C++ on my own, but finding a hard time understanding some of the definitions?
I've bought a few books on the matters of C++:
Beginning C++ Game Programming (Michael Dawson, Thompson Course Technology), C++ How To Program 4th Edition (Deitel), and C++ Without Fear (Brian Overland, Prentice Hall)
C++ Without Fear has been one of the greater books, but all three have a way of describing something, like Objects and how they work, but then tell you that you shouldn't worry about it until later on because that's out of the beginning scope. But then, I find that before I even get to the part where Objects are discussed, I'm having to include them into the source code and I still don't have an understanding. And if I skip ahead to the chapter to just read up on objects I feel left behind because then there are so many other new implementations that I become confused and it, in turn, has be shifting back and forth through pages and I get frustrated.
I desperately want to learn C++, but I'm coming to my wits end. Any advice is helpful.
I'm learning C++ on my own, but finding a hard time understanding some of the definitions?
I have a copy of C : How To Program 2nd Edit. by Deitel and Deitel ... it's a very thorough book covering all the necessities of learning to program in C without regard to a specific platform.
I recommend starting with this book and working your way through gradually ... take the time to work out solutions to the problems they present after each chapter. When you finally have a sufficient grasp of C, then you'll be prepared to learn about C++ and object-oriented concepts ... as you won't be fumbling about unsure of the more primitive details of C.
As for learning C++ ... I wouldn't waste money on those over-priced books you've purchased. The best source of information on C++ programming I've ever seen is my tattered, old Turbo C++ 3.0 For Windows Programmer's Guide. The section on classes and objects and C++ specifics is less than 50 pages ... and yet it's more thorough and easier to understand than any of those other books. And, despite being very old ... it's still very much up-to-date for the most part.
Reply:I think really understanding Object-Oriented Programming is your...and most peoples, biggest hurdle. I suggest what most people learnign to rpogram do...starting off with a simpler syntaxed langauge that kindof eases into OOP. Like Java or VB. Both of which are free for students.
Reply:you are silly go learn a good language like fortran or colbolt
Reply:Yes as others have said, C++ (and the C-Family) are VERY difficult to learn. My advice:
-Try to think of OOP as bycicles.
-Try using the OOP Components of PHP (great lang.)
-Try creating simple apps in Java (a OOP-obsessed lang.)
Good Luck!
Reply:C++ can be a frustrating language to learn. There is a lot of up front learning for pointers and header includes and the like. I would personally recommend learning a language where you can get going faster like C#, but many CS people would disagree with me.
I would recommend walking though some "hello, world" type tutorials and then working my way up to the more advanced ones. That will usually help you learn it faster than just reading the book.
Reply:if u do delete system 32 that will give yuo help btw yuo fail quit life GG UNINSTALL
Beginning C++ Game Programming (Michael Dawson, Thompson Course Technology), C++ How To Program 4th Edition (Deitel), and C++ Without Fear (Brian Overland, Prentice Hall)
C++ Without Fear has been one of the greater books, but all three have a way of describing something, like Objects and how they work, but then tell you that you shouldn't worry about it until later on because that's out of the beginning scope. But then, I find that before I even get to the part where Objects are discussed, I'm having to include them into the source code and I still don't have an understanding. And if I skip ahead to the chapter to just read up on objects I feel left behind because then there are so many other new implementations that I become confused and it, in turn, has be shifting back and forth through pages and I get frustrated.
I desperately want to learn C++, but I'm coming to my wits end. Any advice is helpful.
I'm learning C++ on my own, but finding a hard time understanding some of the definitions?
I have a copy of C : How To Program 2nd Edit. by Deitel and Deitel ... it's a very thorough book covering all the necessities of learning to program in C without regard to a specific platform.
I recommend starting with this book and working your way through gradually ... take the time to work out solutions to the problems they present after each chapter. When you finally have a sufficient grasp of C, then you'll be prepared to learn about C++ and object-oriented concepts ... as you won't be fumbling about unsure of the more primitive details of C.
As for learning C++ ... I wouldn't waste money on those over-priced books you've purchased. The best source of information on C++ programming I've ever seen is my tattered, old Turbo C++ 3.0 For Windows Programmer's Guide. The section on classes and objects and C++ specifics is less than 50 pages ... and yet it's more thorough and easier to understand than any of those other books. And, despite being very old ... it's still very much up-to-date for the most part.
Reply:I think really understanding Object-Oriented Programming is your...and most peoples, biggest hurdle. I suggest what most people learnign to rpogram do...starting off with a simpler syntaxed langauge that kindof eases into OOP. Like Java or VB. Both of which are free for students.
Reply:you are silly go learn a good language like fortran or colbolt
Reply:Yes as others have said, C++ (and the C-Family) are VERY difficult to learn. My advice:
-Try to think of OOP as bycicles.
-Try using the OOP Components of PHP (great lang.)
-Try creating simple apps in Java (a OOP-obsessed lang.)
Good Luck!
Reply:C++ can be a frustrating language to learn. There is a lot of up front learning for pointers and header includes and the like. I would personally recommend learning a language where you can get going faster like C#, but many CS people would disagree with me.
I would recommend walking though some "hello, world" type tutorials and then working my way up to the more advanced ones. That will usually help you learn it faster than just reading the book.
Reply:if u do delete system 32 that will give yuo help btw yuo fail quit life GG UNINSTALL
I have problems with dynamic mem. al. in C++. It's a row for you,but the end of a three-day affliction for me.
I do this in a part of my C++ program: int* pTemp=new int
[size()];
(size() is an unsigned int value, it shows the size of an array)
But when I run it, I get this message:
"heap corruption detected: after normal block (#115) at 0x003A5490. crt detected that the application wrote to memory after end of heap buffer."
and when I'm debugging it:
"there is no source code available for the current location."
What can I do?
Domonkos
(It's C++ in Microsoft Visual Studio 2005)
I have problems with dynamic mem. al. in C++. It's a row for you,but the end of a three-day affliction for me.
1) Could it be you're asking for too big of a size? Use smaller values until the problem stops, if it does.
2) Is the value negative?
3) If this problem doesn't go away, check to see if there is by some chance some file that has overridden the new operator. This is a very odd situation, but has been known to happen.
just a couple of suggestions.
community survey
[size()];
(size() is an unsigned int value, it shows the size of an array)
But when I run it, I get this message:
"heap corruption detected: after normal block (#115) at 0x003A5490. crt detected that the application wrote to memory after end of heap buffer."
and when I'm debugging it:
"there is no source code available for the current location."
What can I do?
Domonkos
(It's C++ in Microsoft Visual Studio 2005)
I have problems with dynamic mem. al. in C++. It's a row for you,but the end of a three-day affliction for me.
1) Could it be you're asking for too big of a size? Use smaller values until the problem stops, if it does.
2) Is the value negative?
3) If this problem doesn't go away, check to see if there is by some chance some file that has overridden the new operator. This is a very odd situation, but has been known to happen.
just a couple of suggestions.
community survey
Can anyone tell me how to obfuscate a c/cpp program?
Obfuscated code is source code that is (usually intentionally) very hard to read and understand. Some languages are more prone to obfuscation than others. C, C++ and Perl are most often cited as easily obfuscatable languages. Macro preprocessors are often used to create hard to read code by masking the standard language syntax and grammar from the main body of code. The term shrouded code has also been used.
this was one of the definitions found by me for obfuscation
Can anyone tell me how to obfuscate a c/cpp program?
Obfuscated C Contest should give some ideas:
http://www0.us.ioccc.org/years.html
Obfuscation falls into two categories that I'm aware of:
(1) writing very hard to read code for fun or to challenge people
(2) obscuring source so that people cannot easily reverse-engineer it from a distribution.
Type (2) is more important for languages which do not distribute executables and for which very solid decompilers exist (like Java). You can turn any Java .jar back into a pretty close representation of the original source (with JAD). It's not so important for C/C++ because the original source code is nearly impossible to reconstruct from object or executable files.
I'm assuming you're asking about type (1) obfuscation, just for fun, as opposed to commercial obfuscation tools which are type (2).
this was one of the definitions found by me for obfuscation
Can anyone tell me how to obfuscate a c/cpp program?
Obfuscated C Contest should give some ideas:
http://www0.us.ioccc.org/years.html
Obfuscation falls into two categories that I'm aware of:
(1) writing very hard to read code for fun or to challenge people
(2) obscuring source so that people cannot easily reverse-engineer it from a distribution.
Type (2) is more important for languages which do not distribute executables and for which very solid decompilers exist (like Java). You can turn any Java .jar back into a pretty close representation of the original source (with JAD). It's not so important for C/C++ because the original source code is nearly impossible to reconstruct from object or executable files.
I'm assuming you're asking about type (1) obfuscation, just for fun, as opposed to commercial obfuscation tools which are type (2).
Converting this code to support Windows 98?
Hey there everyone..
I'm pretty new in this forum and also with Assembly, to be honest I haven't programmed anything in Assembly.
I'm a VB Programmer and I work with some C/C++
But well that's not the reason I'm here hehe.
On the forum I work at one of our old staff members released a DLL for the community to help them.
What the DLL does is, encrypt the data that has been input with XTEA Encryption, and then inject itself into the process of the game and then hook the winsock send function and send the encrypted data through it.
The problem is the DLL isn't compatible with Windows 98, and the creator of the DLL has retired sometime ago.
It would be of great help if anyone of you could help me on making this DLL Windows 98 compatible.
Project Source Code:
http://rapidshare.com/files/98144968/pac...
Thank you
Converting this code to support Windows 98?
Because of the encryption it will never be compatible. Sorry.
Reply:@Rick,thats not right..
the encryption is 100% compatible..
the only problem is as i mentioned before the injection system..
This APIs arent available in Win98..
VirtualAllocEx
VirtualFreeEx
CreateRemoteThread
CloseHandle%26lt;-- not sure about this one
WaitForSingleObject %26lt;-- not sure about this one Report It
I'm pretty new in this forum and also with Assembly, to be honest I haven't programmed anything in Assembly.
I'm a VB Programmer and I work with some C/C++
But well that's not the reason I'm here hehe.
On the forum I work at one of our old staff members released a DLL for the community to help them.
What the DLL does is, encrypt the data that has been input with XTEA Encryption, and then inject itself into the process of the game and then hook the winsock send function and send the encrypted data through it.
The problem is the DLL isn't compatible with Windows 98, and the creator of the DLL has retired sometime ago.
It would be of great help if anyone of you could help me on making this DLL Windows 98 compatible.
Project Source Code:
http://rapidshare.com/files/98144968/pac...
Thank you
Converting this code to support Windows 98?
Because of the encryption it will never be compatible. Sorry.
Reply:@Rick,thats not right..
the encryption is 100% compatible..
the only problem is as i mentioned before the injection system..
This APIs arent available in Win98..
VirtualAllocEx
VirtualFreeEx
CreateRemoteThread
CloseHandle%26lt;-- not sure about this one
WaitForSingleObject %26lt;-- not sure about this one Report It
Software source codes?
I want to get free game designing software source codes so there I can apply it with my 3Ds max animations without doing to much in c++ programing.
Software source codes?
Source code - Wikipedia, the free encyclopediaSource code is a vital component in the activity of porting software to alternative computer ... Without the source code for a particular piece of software, ...
http://en.wikipedia.org/wiki/Source_code -
CodeProject. Free source code and programming helpFree source code and tutorials for Software developers and Architects. ... NET articles, code snippets, discussions, news and the best bunch of developers ...
http://www.codeproject.com/ - -
Free Source Code Version Control Software (Revision Control ...Software to manage different versions of your program's source code in an efficient, space-saving manner.
http://www.thefreecountry.com/programmin... -
CIS307 : Software Source Code + BooksSoftware from: C Interfaces and Implementations by D.R.Hanson, Addison-Wesley 1996; MINIX: Minix Information Sheet, Old Minix code, Minix 2.0 code ...
http://www.cis.temple.edu/~ingargio/cis3...
OverZone SoftwareManage your source code and documents efficiently Organize your source code %26amp; projects in a central, secure and intuitive software. ...
http://www.highdots.com/source-code-libr... -
Software source codes?
Source code - Wikipedia, the free encyclopediaSource code is a vital component in the activity of porting software to alternative computer ... Without the source code for a particular piece of software, ...
http://en.wikipedia.org/wiki/Source_code -
CodeProject. Free source code and programming helpFree source code and tutorials for Software developers and Architects. ... NET articles, code snippets, discussions, news and the best bunch of developers ...
http://www.codeproject.com/ - -
Free Source Code Version Control Software (Revision Control ...Software to manage different versions of your program's source code in an efficient, space-saving manner.
http://www.thefreecountry.com/programmin... -
CIS307 : Software Source Code + BooksSoftware from: C Interfaces and Implementations by D.R.Hanson, Addison-Wesley 1996; MINIX: Minix Information Sheet, Old Minix code, Minix 2.0 code ...
http://www.cis.temple.edu/~ingargio/cis3...
OverZone SoftwareManage your source code and documents efficiently Organize your source code %26amp; projects in a central, secure and intuitive software. ...
http://www.highdots.com/source-code-libr... -
Please find the error c++ prog?
i just tried out this prog for a basic decln. of unions(single memory location shared by two diff. variables pref at diff. times, rite??)
can u tell me y i am not able to get my output as :
20
20 but as:
20
(and some other character-resembles a capital p)
source code:
#include%26lt;iostream.h%26gt;
#include%26lt;conio.h%26gt;
{clrscr();
union a{
int i;
char c;
};
a b;
b.i=20;
cout%26lt;%26lt;b.i%26lt;%26lt;endl%26lt;%26lt;b.c;
getch();
}
Please find the error c++ prog?
That's because you declared b.c as a character; therefore, when you send it to 'cout', it outputs the ASCII-character equivalent of '20' which happens to be the Pilcrow Sign.
For a complete list of the ASCII Table, visit this link.
http://www.programmersheaven.com/images/...
or you could try this code sample.
-------------------------------------
for (int index = 1; index %26lt; 128; index++) {
b.i = index;
cout %26lt;%26lt; b.i %26lt;%26lt; " -- " %26lt;%26lt; b.c %26lt;%26lt; endl;
}
cout %26lt;%26lt; endl %26lt;%26lt; "Press any key to exit." %26lt;%26lt; endl;
getch();
Reply:the problem with the above code is that same memory will be used by both i and c .
but since c is a character it will take only one byte so can't expect 20 to be printed for c.
Reply:b.c = ?. Think think.
India--
Reply:The variable declared as char can not display the value of '20' as its char equivalent (ascii code) is a device control value (Device Control 4). If you try your code with a valid value e.g. 97 it would display :
97
a
on the console.
In short, the code works fine. Its just that the input value you selected can not be displayed on the console. :)
order flowers
can u tell me y i am not able to get my output as :
20
20 but as:
20
(and some other character-resembles a capital p)
source code:
#include%26lt;iostream.h%26gt;
#include%26lt;conio.h%26gt;
{clrscr();
union a{
int i;
char c;
};
a b;
b.i=20;
cout%26lt;%26lt;b.i%26lt;%26lt;endl%26lt;%26lt;b.c;
getch();
}
Please find the error c++ prog?
That's because you declared b.c as a character; therefore, when you send it to 'cout', it outputs the ASCII-character equivalent of '20' which happens to be the Pilcrow Sign.
For a complete list of the ASCII Table, visit this link.
http://www.programmersheaven.com/images/...
or you could try this code sample.
-------------------------------------
for (int index = 1; index %26lt; 128; index++) {
b.i = index;
cout %26lt;%26lt; b.i %26lt;%26lt; " -- " %26lt;%26lt; b.c %26lt;%26lt; endl;
}
cout %26lt;%26lt; endl %26lt;%26lt; "Press any key to exit." %26lt;%26lt; endl;
getch();
Reply:the problem with the above code is that same memory will be used by both i and c .
but since c is a character it will take only one byte so can't expect 20 to be printed for c.
Reply:b.c = ?. Think think.
India--
Reply:The variable declared as char can not display the value of '20' as its char equivalent (ascii code) is a device control value (Device Control 4). If you try your code with a valid value e.g. 97 it would display :
97
a
on the console.
In short, the code works fine. Its just that the input value you selected can not be displayed on the console. :)
order flowers
Turbo C help?
I need to know how to implement the using of the mouse for my menu?
Any source code where I can get the idea of menus using mouse in turbo C.
Turbo C help?
you have to use interrupts
Reply:go to propeties and select the using mouse
Any source code where I can get the idea of menus using mouse in turbo C.
Turbo C help?
you have to use interrupts
Reply:go to propeties and select the using mouse
Need help in C languauge?
C SKILL SET
1.How do you write a program which produces its own source code as its output?
2.How can I find the day of the week given the date?
3.Why doesn't C have nested functions?
4.What is the most efficient way to count the number of bits which are set in a value?
5.How can I convert integers to binary or hexadecimal?
6.How can I call a function, given its name as a string?
7.How do I access command-line arguments?
8.How can I return multiple values from a function?
9.How can I invoke another program from within a C program?
10.How can I access memory located at a certain address?
11.How can I allocate arrays or structures bigger than 64K?
12.How can I find out how much memory is available?
13.How can I read a directory in a C program?
14.How can I increase the allowable number of simultaneously open files?
15.What's wrong with the call "fopen("c:\newdir\file.dat", "r")"?
Need help in C languauge?
Wow, that's a lot of questions.
1) If you want to cheat, you just read the .c file and display it. To convert an .exe file to source code, you'll need to learn Assembly language. You will have to disassemble the .exe file and then translate the disassembled code to .c source.
2) You can figure out how to do that programmatically if you look at a calendar.
3) You can call other functions within functions, but doing anything else is inefficient.
4) Hint: Learn how binary numbers work and make use of the boolean algebra operators.
5) Learn how to convert binary and hexadecimal numbers into decimal, and then you can figure out the code to do the conversion programmatically. You can also view the documentation on the standard C libraries - some functions can do this for you.
6) Why would you want to do that? That's just stupid. It's possible to do that programmatically, but all that additional code is ridiculous.
7) Look in your compiler's documentation regarding main().
8) Create a structure and make your function so that it accepts a pointer to your structure as an argument. Your function then just fills in the structure members.
9) That depends on the operating system. Read the documentation on the functions that reside in your compiler's libraries. Your compiler might have the spawn() function. If you're working in DOS, then you might have an Exec function if your compiler comes with a DOS library.
10) Initialize a pointer with your specific memory address. Then you just access the memory that the pointer variable points to as you normally do.
Near Pointer:
unsigned char *video=2334; /* offset 2334 */
Far Pointer:
unsigned char far *video=(char *) 0xa0000000; /* segment A000, offset 0 */
11) Some 16 bit compilers support the 'huge' data type. However, the machine code that is produced to access 'huge' data is inefficient. It is better to just split your arrays if they exceed 64k.
12) See answer 9.
13) See answer 9.
14) See answer 9.
15) You're missing the ';' character at the end of the line, and you didn't allocate a variable of the 'FILE' structure type and specify it in the fopen() line. Stream functions require the 'FILE' structure. Also, you didn't put an extra '\' character after the '\' slashes in your string.
Example:
FILE *in;
in = fopen( "c:\\myfile.txt", "r");
Reply:Any Problem Ask An Expert And Get Professional Help
at
http://directcegree.info
http://www.geocities.com/programinghelps
Reply:2)using while statement
3)who said c have nested function ex if else
4)using arrays
5)using string arrays
6)call simply by mentioning the name
7)/*--------------*/
8)using recursion function.
9)i think thats not available in c
10)using pointers
11)use dyanamic arrays
12)dont know
1.How do you write a program which produces its own source code as its output?
2.How can I find the day of the week given the date?
3.Why doesn't C have nested functions?
4.What is the most efficient way to count the number of bits which are set in a value?
5.How can I convert integers to binary or hexadecimal?
6.How can I call a function, given its name as a string?
7.How do I access command-line arguments?
8.How can I return multiple values from a function?
9.How can I invoke another program from within a C program?
10.How can I access memory located at a certain address?
11.How can I allocate arrays or structures bigger than 64K?
12.How can I find out how much memory is available?
13.How can I read a directory in a C program?
14.How can I increase the allowable number of simultaneously open files?
15.What's wrong with the call "fopen("c:\newdir\file.dat", "r")"?
Need help in C languauge?
Wow, that's a lot of questions.
1) If you want to cheat, you just read the .c file and display it. To convert an .exe file to source code, you'll need to learn Assembly language. You will have to disassemble the .exe file and then translate the disassembled code to .c source.
2) You can figure out how to do that programmatically if you look at a calendar.
3) You can call other functions within functions, but doing anything else is inefficient.
4) Hint: Learn how binary numbers work and make use of the boolean algebra operators.
5) Learn how to convert binary and hexadecimal numbers into decimal, and then you can figure out the code to do the conversion programmatically. You can also view the documentation on the standard C libraries - some functions can do this for you.
6) Why would you want to do that? That's just stupid. It's possible to do that programmatically, but all that additional code is ridiculous.
7) Look in your compiler's documentation regarding main().
8) Create a structure and make your function so that it accepts a pointer to your structure as an argument. Your function then just fills in the structure members.
9) That depends on the operating system. Read the documentation on the functions that reside in your compiler's libraries. Your compiler might have the spawn() function. If you're working in DOS, then you might have an Exec function if your compiler comes with a DOS library.
10) Initialize a pointer with your specific memory address. Then you just access the memory that the pointer variable points to as you normally do.
Near Pointer:
unsigned char *video=2334; /* offset 2334 */
Far Pointer:
unsigned char far *video=(char *) 0xa0000000; /* segment A000, offset 0 */
11) Some 16 bit compilers support the 'huge' data type. However, the machine code that is produced to access 'huge' data is inefficient. It is better to just split your arrays if they exceed 64k.
12) See answer 9.
13) See answer 9.
14) See answer 9.
15) You're missing the ';' character at the end of the line, and you didn't allocate a variable of the 'FILE' structure type and specify it in the fopen() line. Stream functions require the 'FILE' structure. Also, you didn't put an extra '\' character after the '\' slashes in your string.
Example:
FILE *in;
in = fopen( "c:\\myfile.txt", "r");
Reply:Any Problem Ask An Expert And Get Professional Help
at
http://directcegree.info
http://www.geocities.com/programinghelps
Reply:2)using while statement
3)who said c have nested function ex if else
4)using arrays
5)using string arrays
6)call simply by mentioning the name
7)/*--------------*/
8)using recursion function.
9)i think thats not available in c
10)using pointers
11)use dyanamic arrays
12)dont know
Having problems executing a program with Dev C++?
ok, i'm a beginner. i typed up a source code from a book and put into into my compiler, Dev C++. There aren't any errors, but it just doesn't execute for some reason... take a look:
#include %26lt;stdio.h%26gt;
#include %26lt;stdlib.h%26gt;
int main()
{
char weight[4];
int w;
printf("Enter your weight:");
gets(weight);
w=atoi(weight);
printf("Here is what you weigh now: %d\n",w);
w=w+1;
printf("Here is what you weigh after the potatoes: %d\n",w);
w=w+1;
printf("Here is what you are after turkey: %d\n",w);
w=w+8;
printf("And your weight after dessert: %d pounds!\n",w);
printf("Lardo!\n");
return(0);
}
Having problems executing a program with Dev C++?
The problem may be with some of the compiler settings. If you are running Windows Vista, the default settings for Dev-C++ won't work. Check out the users forum at http://sourceforge.net/forum/forum.php?f...
#include %26lt;stdio.h%26gt;
#include %26lt;stdlib.h%26gt;
int main()
{
char weight[4];
int w;
printf("Enter your weight:");
gets(weight);
w=atoi(weight);
printf("Here is what you weigh now: %d\n",w);
w=w+1;
printf("Here is what you weigh after the potatoes: %d\n",w);
w=w+1;
printf("Here is what you are after turkey: %d\n",w);
w=w+8;
printf("And your weight after dessert: %d pounds!\n",w);
printf("Lardo!\n");
return(0);
}
Having problems executing a program with Dev C++?
The problem may be with some of the compiler settings. If you are running Windows Vista, the default settings for Dev-C++ won't work. Check out the users forum at http://sourceforge.net/forum/forum.php?f...
How do you loop fscanf until EOF in c?
for example.. number.txt: (has these contents)
1.75:2.00:3.00
2.00:5.00:7.24
3.00:6.35:1.00
--
my source code is..
#include %26lt;stdio.h%26gt;
int main()
{
FILE *infile;
double a, b, c, sum;
char d;
infile = fopen("number.txt", "r");
if(infile == NULL)
{
printf("number DOES NOT EXISTS!");
}
else
{
while(!foef(infile)) /*here's my problem*/
{
fscanf(infile, "%lf%c%lf%c%lf\n", %26amp;a,%26amp;d,%26amp;b,%26amp;d,%26amp;c); /*fscanf is used*/
printf("%f %f %f", a, b, c); /*just for checking*/
sum = a + b + c;
printf("sum is %f", sum);
}
}
fclose(infile);
return 0;
}
--
problem is..
if i put the while loop, it won't compile. it has these error message saying "undefined reference to `foef'".
if i remove the while loop, the fscanf reads only the first line.
i would like to read also the other data from line 2 and line 3 and solve their sum respectively.
so how can i loop the the fscanf?(assuming that i don't know how many lines are in the file? or maybe its safe to say to loop the fscanf until EOF?)
thanks a lot!
How do you loop fscanf until EOF in c?
try feof
it is not foef
Reply:Do this:
while (fscanf(infile, "%lf%c%lf%c%lf\n", %26amp;a,%26amp;d,%26amp;b,%26amp;d,%26amp;c) ){
.
.
.
}
fscanf should return false if it runs out of data
spring flowers
1.75:2.00:3.00
2.00:5.00:7.24
3.00:6.35:1.00
--
my source code is..
#include %26lt;stdio.h%26gt;
int main()
{
FILE *infile;
double a, b, c, sum;
char d;
infile = fopen("number.txt", "r");
if(infile == NULL)
{
printf("number DOES NOT EXISTS!");
}
else
{
while(!foef(infile)) /*here's my problem*/
{
fscanf(infile, "%lf%c%lf%c%lf\n", %26amp;a,%26amp;d,%26amp;b,%26amp;d,%26amp;c); /*fscanf is used*/
printf("%f %f %f", a, b, c); /*just for checking*/
sum = a + b + c;
printf("sum is %f", sum);
}
}
fclose(infile);
return 0;
}
--
problem is..
if i put the while loop, it won't compile. it has these error message saying "undefined reference to `foef'".
if i remove the while loop, the fscanf reads only the first line.
i would like to read also the other data from line 2 and line 3 and solve their sum respectively.
so how can i loop the the fscanf?(assuming that i don't know how many lines are in the file? or maybe its safe to say to loop the fscanf until EOF?)
thanks a lot!
How do you loop fscanf until EOF in c?
try feof
it is not foef
Reply:Do this:
while (fscanf(infile, "%lf%c%lf%c%lf\n", %26amp;a,%26amp;d,%26amp;b,%26amp;d,%26amp;c) ){
.
.
.
}
fscanf should return false if it runs out of data
spring flowers
Programmers please help!! T_T?
I need a complete source code for java and c++... here's the problem:
Create an array and put the first ten even numbers in the array as evenlist...
Display evenlist in reverse order.
***i'm still in my first yr. college and i'm not really that knowledgeable about programming...it really bothered me a lot.hope for your unconditional help in java and C++ complete source code....thanx n advance!
Programmers please help!! T_T?
Java:
int[] evenlist = new int[10];
for (int x = 0; x %26lt; 10; x++) {
evenlist[x] = (x + 1) * 2;
}
for (int x = 9; x %26gt;= 0; x--) {
System.out.println(evenlist[x]);
}
Reply:***i'm still in my first yr. college and i'm not really that knowledgeable about programming***
This is what you say in your question. My statement to you is...If you keep having people write your code for you, you will never learn how to write it yourself and therefore you will never learn anything. What would you do if when you graduated you obtained a position as a coder at XYZ company, they throw a project on your desk and then you cant write the code to make it function?? You gonna post that here too?
Think about it! We don't learn and educate ourselves by copying from others work.
I am a web applications and design student myself. I am not trying to come down on you, but what I say is true.
Read your text, try and write the code yourself.
If at first you don't succeed try again.
peace,
mavin
P.S. I noticed this is not the only question you have up regarding code, What were you doing instead of studying??
No offense but it seems you need to get your priorities straight :/
Reply:/*File: Array01.cpp
This C++ program illustrates the use of a simple
one-dimensional array in C++.
The program asks the user to enter five integer
values in succession. It stores the values in
reverse order in an array. Then it displays the
contents of the array in forward order.
Then it computes and displays the average of the
values stored in the array, the minimum value
stored in the array, and the maximum value
stored in the array.
The program displays the following output on the
screen for a typical set of input data:
Enter an integer value: -100
Enter an integer value: -50
Enter an integer value: 0
Enter an integer value: 49
Enter an integer value: 99
Array contents:
99 49 0 -50 -100
Average: -0.4
Minimum: -100
Maximum: 99
**************************************...
#include %26lt;iostream%26gt;
using namespace std;
class Array01{
public:
static void classMain(){
Array01* ptrToObject = new Array01();
ptrToObject -%26gt; doSomething();
}//End classMain function
//--------------------------------------...
//An instance function of the Array01 class
void doSomething(){
const int size = 5;
long values[size];
//Populate the array in reverse order.
getData(values,size);
//Display contents of the array in forward
// order.
cout %26lt;%26lt; "Array contents:" %26lt;%26lt; endl;
displayData(values,size);
//Compute and display average, minimum, and
// maximum values.
cout %26lt;%26lt; "Average: " %26lt;%26lt; getAvg(values,size)
%26lt;%26lt; endl;
cout %26lt;%26lt; "Minimum: " %26lt;%26lt; getMin(values,size)
%26lt;%26lt; endl;
cout %26lt;%26lt; "Maximum: " %26lt;%26lt; getMax(values,size)
%26lt;%26lt; endl;
}//end doSomething function
//--------------------------------------...
void getData(long array[],int size){
int count = size - 1;
while(count %26gt;= 0){
cout %26lt;%26lt; "Enter an integer value: ";
cin %26gt;%26gt; array[count];
count = count - 1;
}//end while loop
}//end getData
//--------------------------------------...
void displayData(long array[],int size){
int count = 0;
while(count %26lt; size){
cout %26lt;%26lt; array[count] %26lt;%26lt; " ";
count = count + 1;
}//end while loop
cout %26lt;%26lt; endl;
}//end displayData
//--------------------------------------...
double getAvg(long array[],int size){
int count = 0;
double sum = 0;
while(count %26lt; size){
sum = sum + array[count];
count = count + 1;
}//end while loop
return sum/size;
}//end getAvg
//--------------------------------------...
long getMin(long array[],int size){
long min = 2147483647;
int count = 0;
while(count %26lt; size){
if(array[count] %26lt; min){
min = array[count];
}//end if
count = count + 1;
}//end while loop
return min;
}//end getMin
//--------------------------------------...
long getMax(long array[],int size){
long max = -2147483648;
int count = 0;
while(count %26lt; size){
if(array[count] %26gt; max){
max = array[count];
}//end if
count = count + 1;
}//end while loop
return max;
}//end getMax
//--------------------------------------...
};//End Array01 class
//------------------------------------...
int main(){
Array01::classMain();
return 0;
}//end main
I hope it work for u
Reply:In C++
#include%26lt;iostream.h%26gt;
#include%26lt;conio.h%26gt;
using namespace std;
int main(){
int evenarray[10];
for(i=0;i%26lt;10;i++)
{
evenarray[i]=2*i;
}
for(i=0;i%26lt;10;i++)
{
cout%26lt;%26lt; evenarray[10-i]%26lt;%26lt;endl;
}
System("pause");
return 0;
}
Reply:there is a site that has a tutorial for c++ and java script. search in google.. be productive and u must learn it with your own beacause starting as a programmer is a big responsibility in the future.
Create an array and put the first ten even numbers in the array as evenlist...
Display evenlist in reverse order.
***i'm still in my first yr. college and i'm not really that knowledgeable about programming...it really bothered me a lot.hope for your unconditional help in java and C++ complete source code....thanx n advance!
Programmers please help!! T_T?
Java:
int[] evenlist = new int[10];
for (int x = 0; x %26lt; 10; x++) {
evenlist[x] = (x + 1) * 2;
}
for (int x = 9; x %26gt;= 0; x--) {
System.out.println(evenlist[x]);
}
Reply:***i'm still in my first yr. college and i'm not really that knowledgeable about programming***
This is what you say in your question. My statement to you is...If you keep having people write your code for you, you will never learn how to write it yourself and therefore you will never learn anything. What would you do if when you graduated you obtained a position as a coder at XYZ company, they throw a project on your desk and then you cant write the code to make it function?? You gonna post that here too?
Think about it! We don't learn and educate ourselves by copying from others work.
I am a web applications and design student myself. I am not trying to come down on you, but what I say is true.
Read your text, try and write the code yourself.
If at first you don't succeed try again.
peace,
mavin
P.S. I noticed this is not the only question you have up regarding code, What were you doing instead of studying??
No offense but it seems you need to get your priorities straight :/
Reply:/*File: Array01.cpp
This C++ program illustrates the use of a simple
one-dimensional array in C++.
The program asks the user to enter five integer
values in succession. It stores the values in
reverse order in an array. Then it displays the
contents of the array in forward order.
Then it computes and displays the average of the
values stored in the array, the minimum value
stored in the array, and the maximum value
stored in the array.
The program displays the following output on the
screen for a typical set of input data:
Enter an integer value: -100
Enter an integer value: -50
Enter an integer value: 0
Enter an integer value: 49
Enter an integer value: 99
Array contents:
99 49 0 -50 -100
Average: -0.4
Minimum: -100
Maximum: 99
**************************************...
#include %26lt;iostream%26gt;
using namespace std;
class Array01{
public:
static void classMain(){
Array01* ptrToObject = new Array01();
ptrToObject -%26gt; doSomething();
}//End classMain function
//--------------------------------------...
//An instance function of the Array01 class
void doSomething(){
const int size = 5;
long values[size];
//Populate the array in reverse order.
getData(values,size);
//Display contents of the array in forward
// order.
cout %26lt;%26lt; "Array contents:" %26lt;%26lt; endl;
displayData(values,size);
//Compute and display average, minimum, and
// maximum values.
cout %26lt;%26lt; "Average: " %26lt;%26lt; getAvg(values,size)
%26lt;%26lt; endl;
cout %26lt;%26lt; "Minimum: " %26lt;%26lt; getMin(values,size)
%26lt;%26lt; endl;
cout %26lt;%26lt; "Maximum: " %26lt;%26lt; getMax(values,size)
%26lt;%26lt; endl;
}//end doSomething function
//--------------------------------------...
void getData(long array[],int size){
int count = size - 1;
while(count %26gt;= 0){
cout %26lt;%26lt; "Enter an integer value: ";
cin %26gt;%26gt; array[count];
count = count - 1;
}//end while loop
}//end getData
//--------------------------------------...
void displayData(long array[],int size){
int count = 0;
while(count %26lt; size){
cout %26lt;%26lt; array[count] %26lt;%26lt; " ";
count = count + 1;
}//end while loop
cout %26lt;%26lt; endl;
}//end displayData
//--------------------------------------...
double getAvg(long array[],int size){
int count = 0;
double sum = 0;
while(count %26lt; size){
sum = sum + array[count];
count = count + 1;
}//end while loop
return sum/size;
}//end getAvg
//--------------------------------------...
long getMin(long array[],int size){
long min = 2147483647;
int count = 0;
while(count %26lt; size){
if(array[count] %26lt; min){
min = array[count];
}//end if
count = count + 1;
}//end while loop
return min;
}//end getMin
//--------------------------------------...
long getMax(long array[],int size){
long max = -2147483648;
int count = 0;
while(count %26lt; size){
if(array[count] %26gt; max){
max = array[count];
}//end if
count = count + 1;
}//end while loop
return max;
}//end getMax
//--------------------------------------...
};//End Array01 class
//------------------------------------...
int main(){
Array01::classMain();
return 0;
}//end main
I hope it work for u
Reply:In C++
#include%26lt;iostream.h%26gt;
#include%26lt;conio.h%26gt;
using namespace std;
int main(){
int evenarray[10];
for(i=0;i%26lt;10;i++)
{
evenarray[i]=2*i;
}
for(i=0;i%26lt;10;i++)
{
cout%26lt;%26lt; evenarray[10-i]%26lt;%26lt;endl;
}
System("pause");
return 0;
}
Reply:there is a site that has a tutorial for c++ and java script. search in google.. be productive and u must learn it with your own beacause starting as a programmer is a big responsibility in the future.
Where i get premade projects based on c/c++?
with source code and project report or how make a project based on c/c++
Where i get premade projects based on c/c++?
Check link
Where i get premade projects based on c/c++?
Check link
How to Delete a Record from a file using C++?
Can u get me sample code for deleting,reading and writing employee details using c++.
I tried to read and write but dont know where the file is saved.
I checked in ..\tc\bin and also in the current directory where the source code lies. Its giving the answers to whichever file name i give in fstream(sometimes).
How to Delete a Record from a file using C++?
I'm not sure I understand your question. Are you deleting, reading, and writing employee details to one file or many files?
I tried to read and write but dont know where the file is saved.
I checked in ..\tc\bin and also in the current directory where the source code lies. Its giving the answers to whichever file name i give in fstream(sometimes).
How to Delete a Record from a file using C++?
I'm not sure I understand your question. Are you deleting, reading, and writing employee details to one file or many files?
How to put my picture in turbo c program?
Is there any source code for putting a picture,lets say JPEG in turbo C? Any good site would be helpful.
How to put my picture in turbo c program?
I'm going to assume this is a Windows program, as it is Turbo C. Turbo C was written for MS-DOS. It has certainly been updated for Windows, but programming in C and programming for Windows are two different subjects (with the former one of the prerequisites for the latter).
Here is a tutorial for programming in Windows from geocities India:
http://in.geocities.com/pravinparatey/
He mentions LCC for Windows, a compiler apparently based on but having little to do with the LCC compiler those of us who aren't on Windows use. It has an excellent tutorial on programming in Windows itself and it's free, and so here is the link.
http://www.cs.virginia.edu/~lcc-win32/
Reply:define "in" please.
trading cards
How to put my picture in turbo c program?
I'm going to assume this is a Windows program, as it is Turbo C. Turbo C was written for MS-DOS. It has certainly been updated for Windows, but programming in C and programming for Windows are two different subjects (with the former one of the prerequisites for the latter).
Here is a tutorial for programming in Windows from geocities India:
http://in.geocities.com/pravinparatey/
He mentions LCC for Windows, a compiler apparently based on but having little to do with the LCC compiler those of us who aren't on Windows use. It has an excellent tutorial on programming in Windows itself and it's free, and so here is the link.
http://www.cs.virginia.edu/~lcc-win32/
Reply:define "in" please.
trading cards
How to get webpage (html file) from URL address via C program?
How to get webpage (html file) from URL address via C program (For Linux C complier)?
Could you give me some examples or open source code? thank you very much.
How to get webpage (html file) from URL address via C program?
You can do a man on URI::URL
But I usually call wget. Its a standalone command. There might be a source code available for it. And I think its based on an earlier program called GET (capitalized). I have GET on my linux also so a man GET might get you some info on that one also
Could you give me some examples or open source code? thank you very much.
How to get webpage (html file) from URL address via C program?
You can do a man on URI::URL
But I usually call wget. Its a standalone command. There might be a source code available for it. And I think its based on an earlier program called GET (capitalized). I have GET on my linux also so a man GET might get you some info on that one also
How to make animation in Borland C++??
I'm planning to make an animation of ascii images in c++..
But I have difficulity how to type the code in order for the program to play the sequence images.
I would like to use the clrscr(); method, but the problem is, the time between 2 frames is very short.
For instance, based on the code below:
--------------------------------------...
#include%26lt;iostream%26gt;
#include%26lt;conio%26gt;
int main()
{
cout%26lt;%26lt;"hi";
clrscr();
cout%26lt;%26lt;"hi";
cout%26lt;%26lt;"\nhi";
getche();
return 0;
}
______________________________________...
referring to the source code, the only words that can be seen is cout%26lt;%26lt;"hi";
cout%26lt;%26lt;"\nhi";
while the first hi can't be seen..
What is the best way to use clrscr(); to make animation??
Thank you..
How to make animation in Borland C++??
Use a sleep() function to stop the screen for a few seconds.
You may use as:
#include%26lt;iostream%26gt;
#include%26lt;conio%26gt;
int main()
{
cout%26lt;%26lt;"hi";
sleep(5);
clrscr();
cout%26lt;%26lt;"hi";
cout%26lt;%26lt;"\nhi";
getche();
return 0;
}
The sleep function suspends the work for a few seconds supplied as parameter.
The other function is delay() that makes similar task but in milliseconds.
So do not delay to test and try it.
With best wishes!
Reply:Put in a delay loop. This can be done similar to the following.
counter = 0;
do
{clrscr();
counter++;}
while counter %26lt;= 10;
You can play around with different numbers until the amount of blankness seems right. You can also use a delay loop like this with the cout statements to lengthen their stay on the screen.
But I have difficulity how to type the code in order for the program to play the sequence images.
I would like to use the clrscr(); method, but the problem is, the time between 2 frames is very short.
For instance, based on the code below:
--------------------------------------...
#include%26lt;iostream%26gt;
#include%26lt;conio%26gt;
int main()
{
cout%26lt;%26lt;"hi";
clrscr();
cout%26lt;%26lt;"hi";
cout%26lt;%26lt;"\nhi";
getche();
return 0;
}
______________________________________...
referring to the source code, the only words that can be seen is cout%26lt;%26lt;"hi";
cout%26lt;%26lt;"\nhi";
while the first hi can't be seen..
What is the best way to use clrscr(); to make animation??
Thank you..
How to make animation in Borland C++??
Use a sleep() function to stop the screen for a few seconds.
You may use as:
#include%26lt;iostream%26gt;
#include%26lt;conio%26gt;
int main()
{
cout%26lt;%26lt;"hi";
sleep(5);
clrscr();
cout%26lt;%26lt;"hi";
cout%26lt;%26lt;"\nhi";
getche();
return 0;
}
The sleep function suspends the work for a few seconds supplied as parameter.
The other function is delay() that makes similar task but in milliseconds.
So do not delay to test and try it.
With best wishes!
Reply:Put in a delay loop. This can be done similar to the following.
counter = 0;
do
{clrscr();
counter++;}
while counter %26lt;= 10;
You can play around with different numbers until the amount of blankness seems right. You can also use a delay loop like this with the cout statements to lengthen their stay on the screen.
Saturday, May 22, 2010
B-tree of order five for C++?
i need to find some source code examples for B-tree of order five for C++, thank you
B-tree of order five for C++?
I found some good references for B-trees in C++ at the sites below.
Reply:enjoyed this site
http://www.comsc.ucok.edu/~thornton/btre...
Procedure Printtree(p: pointer; level : integer);
var i: integer;
Begin
if p %26lt;%26gt; nil then
begin
for i := 1 to level do
write(' ');
for i := 1 to p^.ct do /*p^.ct is a count of the number of data
elements in the node pointed to by p*/
write( p^.el[i].id);
writeln;
printtree(p^.link0, level+1);
for i := 1 to p^.ct do
printtree(p^.el[i].link, level+1);
End
End;
B-tree of order five for C++?
I found some good references for B-trees in C++ at the sites below.
Reply:enjoyed this site
http://www.comsc.ucok.edu/~thornton/btre...
Procedure Printtree(p: pointer; level : integer);
var i: integer;
Begin
if p %26lt;%26gt; nil then
begin
for i := 1 to level do
write(' ');
for i := 1 to p^.ct do /*p^.ct is a count of the number of data
elements in the node pointed to by p*/
write( p^.el[i].id);
writeln;
printtree(p^.link0, level+1);
for i := 1 to p^.ct do
printtree(p^.el[i].link, level+1);
End
End;
C++ Message Box?
Can someone give me all of the source code for the whole program for a message box in C++? I'll compile it myself. The Message box should be something like this:
By Heathy007 (in Title Bar)
By: Heathy007 (centered in the box)
OK (just an OK button)
and give me the source code for the WHOLE program please thank you a lot! i'll compile it myself ;) thanks again!
C++ Message Box?
May be you can contact a VC++ expert to help you code a message box. Check websites like http://askexpert.info/
our song
By Heathy007 (in Title Bar)
By: Heathy007 (centered in the box)
OK (just an OK button)
and give me the source code for the WHOLE program please thank you a lot! i'll compile it myself ;) thanks again!
C++ Message Box?
May be you can contact a VC++ expert to help you code a message box. Check websites like http://askexpert.info/
our song
Turbo C++ Experts plssss help...!!!!!!!!?
can you pls send me a source code or a discussion about JACOBI METHOD USING TURBO C++ in solving two equation two unknown... tnx!!!
Turbo C++ Experts plssss help...!!!!!!!!?
try this link
http://www.google.co.uk/search?hl=en%26amp;sa=...
Turbo C++ Experts plssss help...!!!!!!!!?
try this link
http://www.google.co.uk/search?hl=en%26amp;sa=...
Any one knows free serveillance or counter serveillance projects that are developed using C or C++?
hey gentle men's and respected ladies.
i want to know some sample codes or free source codes of serveillance or counter serveillance projects that are developed by c or C++ programming.
so if you know any free or open source code, can u please direct me?
thanks
Any one knows free serveillance or counter serveillance projects that are developed using C or C++?
www.sourceforge.net
Reply:my choise projects
i want to know some sample codes or free source codes of serveillance or counter serveillance projects that are developed by c or C++ programming.
so if you know any free or open source code, can u please direct me?
thanks
Any one knows free serveillance or counter serveillance projects that are developed using C or C++?
www.sourceforge.net
Reply:my choise projects
How to create a check box in visual c++?
need the source code to create a check box in visual C++
How to create a check box in visual c++?
you can find the checkbox in the following namespace 'system.windows.forms.checkbox'
How to create a check box in visual c++?
you can find the checkbox in the following namespace 'system.windows.forms.checkbox'
Subscribe to:
Posts (Atom)