Monday, May 24, 2010

Mini projects on computer graphics using c?

or can anyone suggest me a website from where i can download c code(without my lecturer getting any doubt ;-))

Mini projects on computer graphics using c?
http://www.codeproject.com/


http://www.freeprogrammingresources.com/...


http://www.thefreecountry.com/sourcecode...


http://www.programmersheaven.com/


http://msdn.microsoft.com/vstudio/expres...
Reply:how can i type mini project here give ur email id
Reply:Go for


www.codearchive.com


may other are already been provided





or go for some blogs ....





Thank you.





Mandar Gurav


Wlachand College Of Engineering, Sangli,


Maharashtra, India.


How to calculate the inverse of nxn matrix using C/C++?

Does anyone have a C or C++ code that can calculate the inverse of nxn matrix?

How to calculate the inverse of nxn matrix using C/C++?
you can make the calculation with the kramer's rule





Given a 3x3 matrix M:





| A B C |


| |


M = | D E F |


| |


| G H I |





Then the determinant is calculated as follows:





n


---


\ i


det M = / M * submat M * -1


--- 0,i 0,i


i=1


where





submat M defines the matrix composed of all rows and columns of M


ij





excluding row i and column j. submat may be called recursively.


ij


| A B C |


M = | D E F | becomes submat = | E F |


| G H I | 11 | H I |





If the determinant is non-zero then the inverse of the matrix exists.


In this case, the value of each matrix element is defined by:





-1 1 i+j


M = ----- * det submat M * -1


j,i det M i,j


Please help me in for loop using C++?

for loop using TC?


please help me to solve this problem.. i cant help it.. i dont know how to do it.. please....





1 2 3 4 5


2 3 4 5


3 4 5


4 5


5


%26gt;%26gt; that will be the output using for loop





thanks.. please do help me guys

Please help me in for loop using C++?
#include%26lt;stdio.h%26gt;


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


void main()


{


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


{


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


cout%26lt;%26lt;i;


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


getch()


}


}
Reply:using the following loop


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


{


for(j=i;j%26lt;=5lj++)


{


cout%26lt;%26lt;setw(3)%26lt;%26lt;j;


}


cout%26lt;%26lt;endl;


}
Reply:try starting with a for loop to keep count of where you are up to, so it needs to start at 1 and have a max of 5, then it will increment each time ... you know the structure of a for loop -





for (i = 1; i %26lt;= 5; i++) { ... }





then inside that for loop you'll need an output function to print the number you're up to, so, i to your max of 5. this output for loop will end when it reaches 5. so put this for loop inside the curly brackets of your outer for loop.





then you'll go back to your outer for loop which will go to the next number, then your inner for loop will go from there and so on ...





always break your problem down and address one step at a time :)


How do i move files using C program?

i wanna know what should be the logic to write a c program which moves a file from one directory to other location in windows?

How do i move files using C program?
You should use the 'rename' function (not MoveFile, which is not C Runtime but a Windows function). See the link below.
Reply:The logic is:





Move File "F" to location "L".





The syntax depends on how you wanna do it. Do you always want to overwrite any files that might be there already, do you want the new file to append to the old one, do you need to keep old versions of the files, etc.
Reply:MoveFile





The MoveFile function renames an existing file or a directory (including all its children).





QuickInfo


Windows NT: Requires version 3.1 or later.


Windows: Requires Windows 95 or later.


Windows CE: Requires version 1.0 or later.


Header: Declared in winbase.h.


Import Library: Use kernel32.lib.


Unicode: Implemented as Unicode and ANSI versions on Windows NT.

sound cards

Is it possible to program using C++ on a Mac running leopard?

Write computer programs and applications with C++ as the PL.

Is it possible to program using C++ on a Mac running leopard?
Yep...C++ was designed to be portable.


I believe eclipse (eclispe.org) will run fine on a mac, and a few google searches should lead you where you want.
Reply:Yes, Leopard is based off of FreeBSD and the Mach kernel. Like any Unix system, you can usually find GCC on the system.


To find factorial of number using c++?

i want a program which finds factorial upto first 1000 numbers in c++

To find factorial of number using c++?
Try... this cool website:





http://www.pixel2life.com





bye......................................
Reply:main()


{


int


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


{


fact=rec(i) ;


cout %26lt;%26lt; fact ;


}


getch() ;


}





rec( int x)


{


int f ;


if( x==1)


return(1) ;


else


{


f=x*rec(x-1) ;


return(f) ;


}


}








Understood the logic of the above program ?


How to start/restart pc using c language?

the question is write in c language

How to start/restart pc using c language?
The answer is to read the shell script for shutdown in a text editor and go from there.


I want to do programming using C,but I'm not getting any topic.Will u help me???

I don't have any topic for programming.I do not want to waste my time.Please help me.If anybody has any difficulty in any C project,I will help him...

I want to do programming using C,but I'm not getting any topic.Will u help me???
yes swapnil, u can help artii by make a project for her and can help me by giving me 10 points ... !! can u .. !





now the serious part ..





for all C sharpies out there ... !


some mind-scrubbing problems for u ...


(wow its a good idea to save 5 points...)





can u make a programm to calculate factorial of 10000 ... yes it not that easy as u think, even double datatype wont help u ... !





can u make a programm to add 2 numbers without using +,-,*,/,++ %26amp; -- operators ?





can u make a programm to calculate square root of any number. without using sqrt() or any other functions.





can u make a programm of converting a number in decimal notation to binary notation, using 1 loop, no if-else, the main logic must be with in 5-6 lines.





hit my page and contact me for any help on these ... !
Reply:try the hanoi towers, thats a classical example for C, and thats going to entertain you for a while.
Reply:“Andre C” is right. Try the link http://www.cut-the-knot.org/recurrence/h... and see weather you can design it with C program!!!! It’ll drive you crazy!
Reply:Please clearify what you mean by "topic". Also, have you done any programing in other languages like QBASIC or VB?





I hate those damn towers! they can go right to hell!
Reply:han...i need a project in C.....examination management system.....ache se pura project bana dena....please....

liama-song

Dropdownlist in ASP.Net using c#?

I have a dropdownlist named country in the registration form and in the profile form.I want to display the corresponding country name(it is stroed int the database) in the profile form.I'm using dataset for binding the whole form.I knew the itemarry intdex of the dataset too.How can I do this?I had set its AutoPostBack true.Hope u'll help me.

Dropdownlist in ASP.Net using c#?
Once a person selects the initial country from the listing, create a session variable ( Session.Add("Country", value) and then set the ddl on the next page to the value of that session var.





hope this helps,





cheers
Reply:i help you but then you'd take my job.


How can i actually PLAY the game i made using C++?

heres the code im using dev and it compiles but nothing pops up?


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





BITMAP *xSprite;


BITMAP *oSprite;





int board[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0}; //This will be used to keep


//track of the Xs and Os


int curSquare = 0; //This will keep track of the current square


//the selector is on





int turn = 1; //This will keep track of whose turn it is


//1 Will be for X and 2 for O





int x = 0; //X and Y position of selector


int y = 0;





int tempX = 0; //holds temporary values used to clear selector


int tempY = 0;





void setupBoard(){ //This function will draw in the grid





acquire_screen();





line( screen, 200, 0, 200, 480, makecol( 255, 255, 255));


line( screen, 400, 0, 400, 480, makecol( 255, 255, 255));


line( screen, 0, 150, 680, 150, makecol( 255, 255, 255));


line( screen, 0, 300, 680, 300, makecol( 255, 255, 255));





rect( screen, x+1, y+1, x + 199, y + 149, makecol( 255, 255, 0));





release_screen();





}





void updateBoard(){ //draws in selector





rect( screen, tempX+1, tempY+1, tempX + 199, tempY + 149, makecol( 0, 0, 0));


rect( screen, x+1, y+1, x + 199, y + 149, makecol( 255, 255, 0));


rest(100);


}





void announceWinner(){ //Announces the winner








if( turn == 1){


textout_ex( screen, font, "X Wins!!!!", 300, 240, makecol( 255, 0, 0), makecol(0, 0, 0));


} else {


textout_ex( screen, font, "O Wins!!!!", 300, 240, makecol( 255, 0, 0), makecol(0, 0, 0));


}








}





void checkWin(){ //checks for a winner





if( board[0] == turn %26amp;%26amp; board[1] == turn %26amp;%26amp; board[2] == turn){


announceWinner();


} else if( board[0] == turn %26amp;%26amp; board[3] == turn %26amp;%26amp; board[6] == turn){


announceWinner();


} else if( board[0] == turn %26amp;%26amp; board[4] == turn %26amp;%26amp; board[8] == turn){


announceWinner();


} else if( board[1] == turn %26amp;%26amp; board[4] == turn %26amp;%26amp; board[7] == turn){


announceWinner();


} else if( board[2] == turn %26amp;%26amp; board[4] == turn %26amp;%26amp; board[6] == turn){


announceWinner();


} else if( board[2] == turn %26amp;%26amp; board[5] == turn %26amp;%26amp; board[8] == turn){


announceWinner();


} else if( board[3] == turn %26amp;%26amp; board[4] == turn %26amp;%26amp; board[5] == turn){


announceWinner();


} else if( board[6] == turn %26amp;%26amp; board[7] == turn %26amp;%26amp; board[8] == turn){


announceWinner();


}





}











void drawXO(){ //draws in the X and O





acquire_screen();





if(turn == 1){


draw_sprite( screen, xSprite, x, y);


board[curSquare] = 1;


checkWin();


++turn;


} else if( turn == 2){


draw_sprite( screen, oSprite, x, y);


board[curSquare] = 2;


checkWin();


--turn;


}





release_screen();





rest(100);





}





void moveBox(){ //takes input





clear_keybuf();


tempX = x;


tempY = y;





if( key[KEY_UP] %26amp;%26amp; y != 0){





y -= 150;


curSquare -=3;


updateBoard();





} else if( key[KEY_DOWN] %26amp;%26amp; y != 300){





y += 150;


curSquare +=3;


updateBoard();





} else if( key[KEY_RIGHT] %26amp;%26amp; x != 400){





x += 200;


++curSquare;


updateBoard();





} else if( key[KEY_LEFT] %26amp;%26amp; x != 0){





x -= 200;


--curSquare;


updateBoard();





} else if( key[KEY_ENTER] %26amp;%26amp; board[curSquare] == 0){





drawXO();





}





}





int main(){





allegro_init();


install_keyboard();


set_color_depth(16);


set_gfx_mode( GFX_AUTODETECT, 640, 480, 0, 0);





xSprite = load_bitmap( "x.bmp", NULL);





oSprite = load_bitmap( "o.bmp", NULL);





setupBoard();





while( !key[KEY_ESC]){


moveBox();





}





destroy_bitmap( xSprite);


destroy_bitmap( oSprite);





return 0;





}


END_OF_MAIN();

How can i actually PLAY the game i made using C++?
Maybe im not reading it right, but i dont ever see your main access your function that takes input, along with some other functions. Sorry if im not a help. I'm unfamiliar with some of your syntax, and i would have a different style.





But definitely go to the debug tool step over and such.
Reply:Use a debugger and trace your program step-by-step to see what is not working properly.
Reply:try to test your functions parameter


Using glut.dll in C#?

Is there a way to convert glut.dll lybrary for visual C++ so that it can be used in C#?

Using glut.dll in C#?
Conversion isn't what you're looking for here, but rather "wrapping". The API calls have to be wrapped in C# so it's convenient to use. You'll find that mainstream OpenGL %26amp; .NET integration hasn't been a topic of great interest in several years - most hobbyists opt for Direct3D in .NET and development shops have their own methods for tying the two together.





That having been said, the largest project is/was http://csgl.sourceforge.net/ I've used this in the past to a very limited degree. GLUT is fully supported.





A much simpler and smaller project is http://www.colinfahey.com/csharp_wrapper... - all GLU functions are supported.





Both of these projects work well, but active development has ceased. Hope that helps - good luck.
Reply:Well, you can get ahold of the glut source and turn on the CLR flag in the C++ compiler and recompile it into a managed assembly, but that's going to be a lot of work.





Or you can use P/Invoke to call the glut methods.





I know there are managed OpenGL libraries available for C#.





But actually the best is to use managed direct X, as it will allow you to do the same things. Since you're using C#, you're stuck with Windows, so you don't need the portability that the OpenGL platform provides.
Reply:yes.





dunno if it's a good idea or not (due to interop), but you could use the type-library import tool (tlbimp.exe or something like that, it comes with .Net) to create an assembly you can use as a reference.





it will spit out a new dll that you can link to in your project, with no need to do DllImports etc.
Reply:c# really isnt a good platform for 3d graphics programming because you surrender a lot of power for greater simplicity. i suspect that you may have trouble compiling the c++ glut header files in c#. and as far as the .dll goes it sounds like it may be a proprietary .dll for vc++. however i dont really use vc++ for my purposes so i could be proven wrong.


I want to design a program using C, 'the factorial of a +ve number n! is defined as n!=n(n-1)(n-2)...x 1 .

there are no factorials of -ve numbers. design a C program which ask the user to enter a number n and gives the factorial of n. kindly help.

I want to design a program using C, 'the factorial of a +ve number n! is defined as n!=n(n-1)(n-2)...x 1 .
int factorial(int n)


{


int tempAnswer = n;





for(int i=n; i%26gt;0;i--)


{


tempAnswer = tempAnswer*i;


}





return tempAnswer;


}





//Do some printing stuff somewhere else.





int main()


{


int input;


//cin something into input


cout %26lt;%26lt; "The factorial is " %26lt;%26lt; factorial(input) %26lt;%26lt; endl;


return 0;


}
Reply:Did you mean "I want YOU to design a program"?


Here you go, don't forget to add comments.


// factorial by %26lt;insert your name here%26gt;


#include "stdio.h"





int fact(int n)


{


return n?n*fact(n-1):1;


};





int main(int argc, char* argv[])


{


int val;


printf("Factorial! pls enter number\n");


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


val=fact(val);


printf("Factorial is %d\n",val);


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


return 0;


}
Reply:int temp = yourFractorialNumber;





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


{


temp = temp*(num-1);


}





int answer = temp;

garden state

How to write codes using c# for search button?

Doing on a website to search for products using visual studio.

How to write codes using c# for search button?
drag and drop a button and textbox to layout. double click on button. there is a blog code.





write what you like to do.


Any experience using Vitamin C as a preservative for fresh tea and juice?

I want to extend the life of the fresh juice and tea that I make. I want to use preservatives that are not harmful. If you use Vitamin C, how much do you use, and how long does it extend the life of the fresh juice with tea? Thanks...

Any experience using Vitamin C as a preservative for fresh tea and juice?
yup


How to solve this using c++?

there can be minimum of 1 student or maximum 40 students ina class.it is mandatory for all students to take 4 subjacts every semester namely mathematics, science,history and english for the final exam students can get marks between 0 and 100.


write a c++ program to accept number of students in the cladss, all student's names and final exam marks foe each subject.Print the names of students,mark foreach subject,and aggregate in acsending order of the aggregrate marksfor the final exam.

How to solve this using c++?
Yes, it can be done. That's why it was assigned as a class assignment.
Reply:should of cut back on the damn drinking and went to class





if you did go to class change your major





if you did go to class and got something out of it just need a basic understanding of were to start go to devshed.com





it is a forum of programs and designers





good luck
Reply:Hello dear, we are here to solve your problems. we can tell u how to do it. but dont ask us to write the lengthy programs, that is not in the spirit of yahoo answers.


if u want the way, it should be something like, u need to create a class called student, which has all the attributes like 4 subjects, name, id...


depending on the no. of students, dynamically create an array of that class.


use some constraints for cheking input range for marks.


finally use conditional operators to put them in order %26amp; print them using cout.


thats it.
Reply:constraints for 1-40 and 0-100


conditional operators such as if(){} else{} statements


and logical operator such as %26amp;%26amp;, ||





a sorting algorithm to sort by ascending order or predefined library function, if that is applicable in this case.





http://mathbits.com/MathBits/CompSci/Arr...


http://en.wikipedia.org/wiki/Sort_(C++)


How to check a number isPrime using C++?

Preferred using bool isPrime(int number)


{


}

How to check a number isPrime using C++?
The largest possible factor of a number is number / 2 (if you think about this you should be able to verify it in your mind.)





int maxFactor = number / 2;


int testNumber = 2; //don't start at 1, everything is divisible by 1





if(number %26lt; 0)


{


throw logic_error;


}





while(testNumber %26lt;= maxFactor)


{


if(number % testNumber == 0) //if it divides evenly


{


return false;


}


else if(testNumber!=2)


{


testNumber+=2;


}


else if(testNumber == 2)


{


testnumber++;


}


return true;


}
Reply:You can do it quicker by only checking odd numbers after 3, and by stopping the search at the tested number's square root (rounded down to an integer).
Reply:Just like what lansingstudent09101 said but I am not exactly a C++ programmer although i did do it from age 8-11 (trust me i new how to do a lot) but make the int variables any thing you want but change the increment to NULL

funeral flowers

On myspace,everyone is using "c/b" i want to know what it means.?

in pic comments and regular comments ALOT of people are using it. i just want to know what it means.

On myspace,everyone is using "c/b" i want to know what it means.?
"Comment Back"





its the myspace equivalent of saying Write Back
Reply:Comment Back.





This danged kids...
Reply:comment back ☼


How to solve sudoku using "C" language?

hi


any idea?


would it be simple program ( 10 - 15 ) pages





is it easy to write a program in c that solves sudoku boards...


thanks

How to solve sudoku using "C" language?
I think it could range from pretty easy to somewhat difficult depending on how you implement the algorithm.





A simple recursive algorithm could be written to solve it just by trying every different possible combination until it came up with the right answer. This would probably take maybe a page or two of code and very little brain power.





But if you don't like the brute force method, you could implement the algorithm with a little more 'intelligence' to try only the more viable combinations. This probably won't be much longer of a program, but it will be more complex and take more analytical thinking on your behalf.





****Edit****





Well I got a little side tracked from other things and decided to implement a program to solve this problem. I admit its something I've thought about doing for a while, so I figured why not.





Anyway , it was pretty easy; took me about an hour and about 130 lines of code, and works great. It reads the Sudoku board in from a text file, solves it, and then outputs the result to another text file. It uses a recursive algorithm that finds the first empty box on the board, fills it with a valid value, and recursively calls itself to do the same on the next empty box. It will keep going this way until there are no valid values to put in the box, in which case it returns false; or if there are no more empty boxes, in which case it returns true. If false is returned, it will keep trying the next valid value until true is returned or there are no more valid values.





I hope my explanation makes sense; if you sit down and think about it, it's really not that complicated. If you want to see my source code, feel free to email me.
Reply:Like most other problems, a SUDOKU solver can use multiple approaches.


The one which may be appropriate will be Backtracking. You read some notes on how backtracking is done.


The basic concept behind this is,


based on available parameters, you presume some values and when it is found that the values assumed go wrong during the course of solving the problem, you go back one step and try again. In this way, you can bring the solution.


Thank You!!
Reply:I am thinking this would not be a very easy program to write, but that all depends on your level of experience, and your definition of 'easy'. If you think 15 pages of code qualifies as easy, then it may be easy for you. I think it would require very complex logic, similar to that necessary for a chess or checkers game.


I mailed a package using c.o.d. with the post office they lost it can I file a claim and get the value of cod?

I didn't buy insurance but is it insured since it is a c.o.d. ?

I mailed a package using c.o.d. with the post office they lost it can I file a claim and get the value of cod?
No insurance, no claim
Reply:No, you should have insured it.


How can i make a 'library system' using C++ programming ????what can i use data structures or classes???

am a new programming student and i really tried to do this using structures but i failed so plz can anyone help me with that???

How can i make a 'library system' using C++ programming ????what can i use data structures or classes???
I'm not really well acquinted with C++...is the system development restricted to using C++ only, cause if it's not then it would be better to use C# ( C-sharp) instead as it is easier and simpler to use. My advice is to use classes instead so that you can define the relationships between the classes...making programming for the system so much easier! Hope this helps a little:)

floral design

Error deleting record on Excel using C# code, under Microsoft Expression Web. Please Help. Here is my code:?

When I view my web page there's no error that prompts and I can even click my delete button, but when I open my Excel sheet the data is still there. I need your suggestion.





public void delete_Click(Object Src, EventArgs E)


{


string connectionString;





connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +


@"Data Source=C:\Documents and Settings\ojt04\My Documents\mySit\payroll\database\profile... +


"Extended Properties=Excel 8.0;";


OleDbConnection connA = new OleDbConnection(connectionString);


connA.Open();


OleDbCommand command1 = new OleDbCommand("DELETE FROM [profilesheet$](FirstName) WHERE IDNo=txtid.Text",connA);


connA.Close();


txtid.Text="";


txtfname.Text="";


txtlname.Text="";


txtmname.Text="";


txtadd.Text="";


txtbday.Text="";


txtcontact.Text="";


txtposition.Text="";


txtdept.Text="";





}

Error deleting record on Excel using C# code, under Microsoft Expression Web. Please Help. Here is my code:?
This isn't right:


"DELETE FROM [profilesheet$](FirstName) WHERE IDNo=txtid.Text"





It should be


"DELETE FROM [profilesheet$](FirstName) WHERE IDNo=" + txtid.Text





That was the first problem I saw anyway.
Reply:Are you deleting each cell at a time ??? that's the only you can change a excel spreadsheet


Please mention codings using C for this...?

Show the o/p of file C which must be based on the file A %26amp; B?

Please mention codings using C for this...?
do u want to share a variable across multiple file?





then go for EXTERN
Reply:what means o/p?





what means "mention codings"??





if your question would make more sense, you wouldn't have to ask three different times.


Classic multiplication program using C++?

Classic multiplication of any two large integers of any size can be performed using american and english multiplication.

Classic multiplication program using C++?
man this is really simple, you can do it yourself, the only problem I can think is that the answer has maximum digits as the sum of the two numbers you are multiplying (so you have to allocate it and one more for the carry).


How to make chatt room using C# language?

i want to make my final project on chatroom so i want to write the code in c# what are the core thing that i have to know

How to make chatt room using C# language?
hi dear ,first you have to have a good knowledge on staff like html,C# and .... but, it is possible to desigen chat room simply by using frames to desigen

chelsea flower show

Error deleting record on Excel using C# code, under Microsoft Expression Web. Please Help. Here is my code:?

When I view my web page there's no error that prompts and I can even click my delete button, but when I open my Excel sheet the data is still there. I need your suggestion.





public void delete_Click(Object Src, EventArgs E)


{


string connectionString;





connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +


@"Data Source=C:\Documents and Settings\ojt04\My Documents\mySit\payroll\database\profile... +


"Extended Properties=Excel 8.0;";


OleDbConnection connA = new OleDbConnection(connectionString);


connA.Open();


OleDbCommand command1 = new OleDbCommand("DELETE FROM [profilesheet$](FirstName) WHERE IDNo=txtid.Text",connA);


connA.Close();


txtid.Text="";


txtfname.Text="";


txtlname.Text="";


txtmname.Text="";


txtadd.Text="";


txtbday.Text="";


txtcontact.Text="";


txtposition.Text="";


txtdept.Text="";





}

Error deleting record on Excel using C# code, under Microsoft Expression Web. Please Help. Here is my code:?
You don't seem to be getting any help so I will just ask if you know whether the statement





connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +


@"Data Source=C:\Documents and Settings\ojt04\My Documents\mySit\payroll\database\profile... +


"Extended Properties=Excel 8.0;";





needs a continuation character at the end of the second line and perhaps and end quote before it and an opening quote the start line 3?





If I am wrong, just give this answer a thumbs down and I will remove it to increase (however slightly) your chances that someone else will provide and answer.


Transparent Window / Form using C# (application skins)?

I need someone to tell me how i can learn or do this thing. I want to creat my windows applications that has an interface that looks something like the windows media player ,winamp skins or the new MSN messenger 8. How can i do this? can anyone tell me about any books, componets or even write a simple code to do this in C# or VB.NET ? Please, I really wanna learn this. Thank you all for your help

Transparent Window / Form using C# (application skins)?
If you want a Transparent Look to your


Windows applications you can Use a Property called:


"Opacity" for a Windows Form Object.


It's value Lies Between 0% and 100% (both Inclusive)


Less the Opacity Percentage More Transparent is your form.





For Providing Skins You need to Create Custom Images and also


set TranparencyKey [again a property Of for] accordingly.





Also see the Following Links:


http://www.codeproject.com/dotnet/Web_Br...





http://quickstart.developerfusion.co.uk/...





For Creating Custom Shaped forms Visit:


http://www.codeproject.com/csharp/irregu...





Spice Up Your Windows Forms:


http://www.ftponline.com/vsm/2004_11/mag...





Hope this helps
Reply:v1.1 of the .NET framework does not have "skinning" at least in the form you want it. There are lots of libraries that will give you a start, but anything beyond changing basic colors is going to be a chore. But not to leave you without a starting point:





http://yabb.jriver.com/interact/index.ph...
Reply:refer http://www.codeproject.com


Create a database using c?

create a database for employees.first check for syntax("create table employee(name,varchar(20),salary,numeric... the syntax is correct then create a structure employee with name and salary in it.like this do for insert,delete,update.only the syntax is same as in sql.A c program is needed to check the syntax and to create the structure.

Create a database using c?
Your "create table..." statement is SQL statement.


It means, you need connect to some SQL server using DAO/ODBC/ADO/etc. and send to the server your SQL command. What is your SQL server and API you will use - it depends solely on your taste.
Reply:Do you know what you want. When you talk about database, talk about the db software and the sql tools. C and java is only for connectivity and presentation.
Reply:PCQuest : Enterprise : Using FireBird RDBMS


... create a FireBird database called data.fdb in C:\ using the default database ... will create a user 'testuser' with password 'test'. You do this using the sysdba ...


http://www.pcquest.com/content/enterpris...
Reply:what is your question?


Make a labyrinth using c++., java or visual basic?

by using state space search that i did not have any idea at all..we had an assignment to do a labyrinth where the user can decide what direction to take, i only know 3 languages where to do it..but i dont know how..pls help

Make a labyrinth using c++., java or visual basic?
try


gamedev.net


for c++ gaming
Reply:Here's how you use JavaScript to make a maze game: http://javascript.internet.com/games/maz...

apple

Resource for Programming the iPhone using c++?

Is there a book or a website with examples of writing for the iPhone in C++? How do I get started on learning?

Resource for Programming the iPhone using c++?
Here's the unofficial iPhone SDK
Reply:Here Check this out http://freeborn.wordpress.com/2008/03/10...


thats what i used


Can't we use user defined methods of one program in another program using c language?

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


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


float logor(int);


float rootof(int);


main(){


int n,res;


printf("Enter one number");


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


printf("\nThe logorthem value of this number is :%f",logor(n));


printf("\nThe square root of this number is: %f",rootof(n));


getch();


}


float logor(int n){


return log(n);


}


float rootof(int n){


return sqrt(n);


}





In this program we have used two user defined functions. those are logor and the rest is rootof. can we use both of these two things in another program. If not why?. we r using predefined functions like log and sqrt. And these methods are also one of methods in the compiler. But they are being reused. But we can't use user defined methods. can anyone tell me the reason behind this logic?

Can't we use user defined methods of one program in another program using c language?
To use them in another program you have to put them away in the right place so the system can recover them. That file would be included like you have done with math.h


When I was teaching computer literacy, I would point to a floppy disk laying on the table and say, "You have to put that in the drive. The Russians are working on reading diskettes laying on the table, but we don't have it yet."


You are wanting the connection to be made to your function automatically by some kind of mind reading process and that don't happen (yet.)
Reply:It is actually common to share some functions among multiple programs. There are a few ways to do this. However, the best way is to create a library.





First, some explanation. When you make a C program, you have one or more .c files. These are your source files containing your C source code. These are compiled into object files by the compiler. The object files typically are .o or .obj files depending on the compiler. Files like main.c are used to create main.o. The object files contain machine language, which is the language of the CPU.





After the object files are created, they have to be combined to make the final executable. You see, the object files are not really complete. If one object file is trying to call a function in another object file, the compiler cannot really make that happen. So it puts a marker indicating what it wants to do and leaves that final resolution to the linker step.


The last phase is called linking. This is like doing connect the dots. The linker finds all the functions in all the object files then finds all the places where they are called and inserts the actual calls to the functions.





An object file can be used in more than one program by specifying it to the linker.





Programmers are always trying to make life easier. And because this sharing of code is common, they came up with a way to make this process easier. Object files can be combined into a library. At the link phase, instead of linking with the object files, the library is used.





There is nothing that special about a library. It isn't that much different than a zip file that contains multiple files. Using a library or set of object files directly is the same thing. In fact, a program can be built (and often is) from a number of object files and libraries.





All the functions provided by C come from libraries. The C programming language has no built-in functions. So when you write a C program and call printf, you are already using a library.





How you create and use libraries will differ from one compiler to another. Read Read Read.





Good luck.
Reply:If you want to use user defined functions in another program, create a library that contains the functions.


Simple DOS graphics using C?

Hi,


What should I learn to create simple DOS graphics by controlling pixels on the monitor. I already know how to control pixels in assembly, but i wanted it in C

Simple DOS graphics using C?
This will let you create ASCII art, which is character mode graphics. Should work with a PC and any other computer as well. Which is good; it means people will be able to read them on other computers if they get them in their emali or look at them in their web browser or word processor.
Reply:In C on dos use CONIO.h


In C on Unix use Curses.H


How to develop IE Toolbar(toolband) using c#?

I found some sample projects in MSDN and Codeproject, those are in C++, I'll be happy if anybody help me to develop a custom toolbar for IE.

How to develop IE Toolbar(toolband) using c#?
Visual C++ and Visual C# are the same thing, excepting a few changes in built-in classes. You should be able to easily mod C++ code to C#.
Reply:The syntax for managed C++ and C# are completely different. If you are more familar with a Java-like syntax, then I would recommend C# over C++. VB.net is also an option if you are more comfortable with something closer to classic VB.





For an example of a C# customization for IE, I came across the following article on codeproject. Looks like it might help.

augustifolia

Iteration statements using c?

please do help me to my assignment...





i need 5 examples of each statement..





in C LAnguage





1. Do Statement


2. Do-While Statement


3. While STatement





please.. help me.. i really need ur help..

Iteration statements using c?
try this for Do-While and While or for any C help. but what is Do?????? I dont think its there in C lang





http://cprogramming.com


Display this design using C++..?

how do i display an inverted pyramid of asterisks ?...using 'for' loops, 'if' conditions..etc...


as in to display a straight pyramid the code would be:


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


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


void main()


{clrscr();


int i,j,k,l=1,num;


cout%26lt;%26lt;"Enter the no:"%26lt;%26lt;endl;


cin%26gt;%26gt;num;


for(k=num;k%26gt;=1;k--)


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


cout%26lt;%26lt;" ";


if(l%26lt;num)


{ for(j=1;j%26lt;=l;j++)


cout%26lt;%26lt;"*"%26lt;%26lt;" ";


}


l++;


cout%26lt;%26lt;endl;


}

















getch();





}

Display this design using C++..?
//


// Display a pyramid of asterisks, upright or inverted:


// usage: ./pyramid %26lt;n%26gt;


// if n %26lt; 0, the pyramid is inverted.


//


#include %26lt;iostream%26gt;


#include %26lt;iomanip%26gt;


#include %26lt;cstdio%26gt;





using namespace std;





int main(int argc, char *argv[])


{


int n, startX, endX, increment;


const string star("*");





if ((argc %26lt; 2) || (sscanf(argv[1],"%d",%26amp;n) != 1))


{


cout %26lt;%26lt; "usage : " %26lt;%26lt; argv[0] %26lt;%26lt; " n" %26lt;%26lt; endl;


return -1;


}


if (n %26lt; 0) // inverted


{


n *= -1;


startX = n-1;


endX = increment = -1;


}


else // normal


{


startX = 0;


endX = n;


increment = 1;


}


for (int i = startX; i != endX; i += increment)


{


cout %26lt;%26lt; setw(n-i) %26lt;%26lt; star;


for (int j = 1; j %26lt; (i*2)+1; j++) cout %26lt;%26lt; star;


cout %26lt;%26lt; endl;


}


return 0;


}
Reply:Basically, you need to swap the for loop that prints the spaces with the for loop that prints the *.





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


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


int main()


{


clrscr();


int i,j,k,l=1,num;


cout%26lt;%26lt;"Enter the no:"%26lt;%26lt;endl;


cin%26gt;%26gt;num;


for(k=num; k%26gt;=1; k--)


{


for(j=1; j%26lt;=l; j++)


{


cout%26lt;%26lt;" ";


}


if( l %26lt;= num)


{


for(i=k; i%26gt;=1; i--)


cout %26lt;%26lt; "*" %26lt;%26lt; " ";


}


l++;


cout%26lt;%26lt;endl;


}


getch();


return 0;





}


Creating a sql database using c?

i need a program in c and not in c++ or c#

Creating a sql database using c?
What is your question? You can use T-SQL statements to program your SQL database or Visual Basic. Are you asking if you can create a SQL database using the C programming language? Why not use the GUI in Enterprise Manager to create your database? I have never heard of using the C programming language to create a SQL database.
Reply:Creating database in sql? What do you mean creating... Creating a database and table structures or database connection in your c program?!?





What SQL version you are using? and can you rephrase your question. What specifically you want to do between your SQL and C Program.





:)


Since Unix was built using "C" does that mean working in it, is just like working in C or C++?

I am asking this because I want to start working in Unix but I only have knowledge of C++, will it be easy to do?

Since Unix was built using "C" does that mean working in it, is just like working in C or C++?
Knowing Linux commands and bash scripting is far more important for everyday use. Many programs for Linux are obtained by downloading the source code its self and in my experience they are nearly all ways written in C or C++ therefore you need to know how to compile them. By the way KDE is written in C++ and Gnome is written in in C. I like you prefer C++ so I write all my Linux programs for KDE. In theory you can use any language for writing Linux programs your just more likely to see C++ for KDE and C for Gnome.
Reply:nope but unix is not that hard. syntaxes r entirely diff in both these cases!
Reply:Unix is so highly configurable that you can make it work in any way that you like. Seriously, as mentioned shells usually have their own syntax. From a programming perspective, the only time that you will encounter C is when doing low-level system programming. Some examples here include opening sockets or setting up pipes programattically mainly because these deal with file descriptors instead of stdio or iostream file handling libraries. It is pretty straight-forward to write an OO wrapper in C++ around these so that you don't have to deal with them directly in your applications.
Reply:using UNIX is nothing like C++ or C


it mostly depends on the shell you use (if you are doing shell scripting) otherwise you just run commands. there are some technical problems with some shells (like csh) that make some programs malfunction. but the point is, no, it's nothing like C++ or C


it's more like DOS, if that helps

nobile

Detecting simultaneous keypresses using C++/WinAPI?

I am creating a simple game in WinAPI (required for a class to use no DX/OpenGL), and I'm trying to detect when more than one key is pressed at the same time.





Currently if I hold down the UP button, and press with LEFT button, the LEFT button will interrupt the action UP was supposed to be performing. It is currently set up using a switch statement and checking for VK_UP/VK_LEFT.





Is there any way I can have it alternate between both actions instead of only performing one ?

Detecting simultaneous keypresses using C++/WinAPI?
The short answer is raw input (see link below). The VK_ window messages are sorta deprecated in favor processing raw input and for games I'd definitely avoid using the default window messages.


Also, have you looked at directinput? I don't know if dx10 has dropped that project or not.


When using C++, what is the actual numerical value of a relational or logical expression that evaluates as tru

0, -1, 1, or 255? i think it is 255, but i cannot remember b/c i was hungover in class.

When using C++, what is the actual numerical value of a relational or logical expression that evaluates as tru
1.





You can do things like this:





int b = 5;


int x = ((b == 5) * 3); %26lt;-- x will be 3





Note that any non-zero value will evaluate as true, so something like this:





int x = 45;





if (x ) ... will evaluate as true.





To correct Calvin's answer, boolean variables (and all other scalar types) have no default, they must be assigned or they will have the value of whatever was there in memory.





The default for all scalar types is 0 or false, if you use the template assign:





bool x; %26lt;--- x could have any value


bool x = bool(); %26lt;-- Will assign false to x
Reply:I believe it is 1.
Reply:1 (see the code below, which has fewer characters than your question !-)





Btw, this is a question about low-level programming (that is, how a machine implements the concept of 'true'). If you are taking a course in high-level programming, you should chide your teacher.
Reply:It is 1. False is 0.





When you create a boolean variable, it's default value is 0 or false.





Easiest way to remember is that computers use 1's and 0's. This'll get rid of any other values you might think of.


I am using c++ with doubles. say the number is 987654321, it changes it to 987650000. anyone know why? fix?

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


#include %26lt;iostream%26gt;


using namespace std;


#include %26lt;string%26gt;


#include %26lt;fstream%26gt;


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


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





void main()


{


double ktemp=987654321.123456789;


cout %26lt;%26lt; ktemp %26lt;%26lt; endl;


}





it will display 9.87654e+008, and if I divide it by 1000 it shows 987654. this is a huge problem since im dealing with GIS coordinates and I NEED the full value of the number, i get the same problem when writing these values to a file, which is my ultimate goal

I am using c++ with doubles. say the number is 987654321, it changes it to 987650000. anyone know why? fix?
try





int main(int argc, char* argv[])


{


double ktemp=987654321.123456789;


cout.precision(20); // this sets the precision of the output to 20 places.


cout %26lt;%26lt; ktemp %26lt;%26lt; endl;


cout %26lt;%26lt; ktemp/1000. %26lt;%26lt; endl;





return 0;


}


Drawing fractals using C++ and recursion?

similar to:


*


**


.*


****


. *


. **


. *


********


. *


. **


. *


. ****


. *


. **


. *


(don't need the periods)


Create a recursive function to draw a fractal pattern, given a maximum number of stars (which should be a power of 2) and a column on which to begin drawing stars.





The prototype for the function should look like:


void pattern(int nstars, int startcol);





Where nstars is the maximum number of stars to draw essentially the width), and startcol is the column in which to begin drawing stars. Note that the number of stars should always be a power of 2. To help you see the recursive nature of the pattern, consider the pattern produced by pattern(8,0).





i know that it needs a loop in it. Something like:


// A loop to print exactly i spaces:


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


cout %26lt;%26lt; " ";


}


// A loop to print n asterisks, each followed by a space:


for(int k = 0; k %26lt; n; k++){


cout %26lt;%26lt; "* ";


}





I am completely lost on this. How would i do this in C++? Any help would be greatly appreciated!

Drawing fractals using C++ and recursion?
Your function should be





void pattern (int nstars, int startcol)


{


if(nstars != 0)


{


-- loop thru and go to the right column


-- get the random number


-- print as many astrixes as the random number





// recusive call


pattern (nstars - random, startcol);


}





}








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





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


{


cout%26lt;%26lt;" "; //This will move the cursor to the right column


}





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


{


count"*";//Print the asterix


}





cout%26lt;%26lt;endl; //This will move the cursor to the next line and get it ready for the next iteration.





What I don't understand is the number of lines you have don't make sense. you said the image showed 8 stars, but the example you have has more than 8 asterisks.





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





oh ok, I understand now, you have a total of 32 stars and you need to distribute the stars in such a way that no one row will have more than 8 stars.





Thats easy, stick with the code you have written above, you have to select a random number for each row so that you get the number of stars for the row. the random number needs to be between 1 and whatever nstars is. also your recursive function needs to send the total number of stars also. Its based on this that you will perform your recursion





void pattern(int totStars, int nStars, int startCol)


{


if (totStars != 0) // Condition to stop recursion


{


//for loop to get to the right start column


// get random number between 1 and nStars


// for loop to print total number of asterisks


// remember to go to next line


pattern(totStars - randomNum, nStars, startCol) //recursive function call.


}


}

hibiscus

Factorial Program using c++?

Need a program using loop (not if and else)





Need this badly...





Option ! (Factorial)


1. Prompt the user to enter an integer


2. Accept the integer value n


3. Let the integer value a = 1


4. Let a = a * n


5. Let n = n - 1


6. Repeat 4 - 5 while n %26gt; 0


7 display a





I am really not that good in programming so please help with the formula and conditions for the code....please include scanf and printf...

Factorial Program using c++?
try this one:





http://www.cprogramming.com/
Reply:The description is recursive; if/else is implied, what are you asking? How to use :? or while loop or what?
Reply:void main()


{


int n,a,fact=1 ;





printf("Enter the value of number ");


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





while(n!=0)


{


fact=fact*n;


n=n-1;


}


printf("Factorial of %d is %d",n,fact);


getch();


}








use cout and cin in place of printf and scanf ,,,,,,,if u want then i can also do that


I program using c++builder and have created a form with an smtp module on it. i am having trouble sending emai

The module is provided by ICS. I cannot get it to connect correctly. what i am trying to do is embed an emailer on a form so that users can send an email thru my program rather than having to open up outlook and do the same thing. in my program, most of the text and address is automatically put on the email, saving time. however, i can't seem to get the component or module to connect using the command smtp-%26gt;connect() as well as putting in server and port info

I program using c++builder and have created a form with an smtp module on it. i am having trouble sending emai
I believe the file maybe to large to send over the internet. Zip the file using a software such as Winzip.


Help plz using c?

this program reverses the string entered by input from the user.





int main() {


char string[256];


int len;


fgets(file, 256-1, stdin);


len = (strlen(string) - 1);


printf("You entered %s \nlength %d:\n", file, len);


printf("Reverse string:");


for(; len %26gt;= 0; len--)


printf("%c",file[len]);


printf("\n");


}


i need to do this


You will read in a file supplied from the commandline (filename.ext,) and write/overwrite out a file which will be called (filename.ext.mng.)





This file will be essentially the same as the original file, but will have all characters on all lines the reverse of the original. For example:


The original file has:


Jack Spratt


could eat no fat.


His wife


could eat no lean.


The output file will look like:


ttartpS kcaJ


.taf on tae dluoc


efiw siH


.nael on tae dluoc

Help plz using c?
Take out the printf's ("You entered %s....." and "Reverse string...").





Take out the printf("\n"); at the end of the loop.





Then just do it from the command line:





myprog %26lt;filename.ext %26gt;filename.ext.mng
Reply:your reverse program dosen't seem to be working


here is a program that works:


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





void reverse( const char * const sPtr );





int main(){


char sentence[ 80 ];





printf( "Enter a line of text:\n" );


gets( sentence );





printf( "\nThe line printed backwards is:\n" );


reverse( sentence );


}





void reverse( const char * const sPtr ){


if( sPtr[ 0 ] == '\0' ){


return;


}


else{


reverse( %26amp;sPtr[ 1 ] );





putchar( sPtr[ 0 ] );


}


}


Using C how can i create a pointer to a pointer.?

I have a hard time to understand char **abc. Can somebody pls explain this. Tell me how this relate to a string. It is said that abc can be considered as an array. I don't have any idea about how this happens. I'm so confused. Pls explain. I knw some C.

Using C how can i create a pointer to a pointer.?
if you declare a string like





char *myString = "asd";





then myString a pointer to a character. It contains the address of the memory location which contains the character 'a'. Subsequent memory locations (i.e Mystring+1, myString+2) contain the characters 's' and 'd'. Make sure you understand this much before proceeding.





Now, a declaration like


char **abc;


creates a pointer abc that points to (or contains the address of) a character pointer like myString above.





Pointers to pointers are like a treasure hunt games where the first clue tells you where the second clue is; and the second clue tells you where the treasure (data) is.





:) Happy huting !!
Reply:Well first of all I don't think you would normally need to create a pointer to a string which would be a pointer to a pointer.


However it this is what you would like to do then lets simply create a string first:


char s1[] = "Able";





In the instance above s1 is a simple pointer. Assuming that the string s1 is located at memory address 1000 (for illustration purposes) the actual value of s1 would be 1000 demonstrated by:


printf("%d", s1);


However the string pointer s1 is stored elsewhere, say memory address 800. The breakdown of the structure would be :


s1[0] --%26gt; Memory location 1000 --%26gt; A


s1[1] --%26gt; Memory location 1001 --%26gt; b


s1[2] --%26gt; Memory location 1002 --%26gt; l


s1[3] --%26gt; Memory location 1003 --%26gt; e





Now to create a pointer to the you would code:


char *p_s1 = %26amp;s1


Lets assume p_s1 is stored at memory location 2000.


printf("%d", p_s1); would then output 800 the address of the pointer s1, not the address of the string.


Now if you wanted to output the value of the string you would do this syntax **p_s1:





Lets break this down to see what happens


p_s1 gives 800 the address of our string pointer


*p_s1 gives 1000 the dereferenced value of our string pointer


%26amp;p_s1 gives 2000 the memory address of p_s1 (not needed but hre to give reference)





so then:


*p_s1 is equivilent to 1000 (what s1 points too) and


**p_s1 is equivilent to 64 (the character A) the dereferenced value of 1000 or s1





Note the following is NOT a pointer to a pointer but gives an illustration of how pointers and string are commonly used.


This is the code of the ANSI C strlen() function:





int strlen(char *string)


{


char *ptr = string; /* ptr is used to reference each char in the string variable*/


while (*ptr != '\0') ptr++;


return ptr - string;


}





This might be more of what you want to do instead of a pointer to a pointer. Hope this helps
Reply:"char **abc" means "char* abc[]" - or - "abc is an array of pointers to char - we don't know how many elements long".





...and now the windy version...


In C, you don't really have strings at all. The compiler does not know anything about strings.


All you have is arrays of characters.


What makes an array of characters behave as a string are the standard C library functions, which expect the end of the string to always be marked with a "nul" character, 0x00.


Moving on to arrays...


When you declare an array you tell the compiler the name or symbol you want it to have, the type of data it will contain, and the number of elements. e.g.


int A[5];


Now the compiler initially uses this information to allocate space for the array, in this case 5 * sizeof(int) bytes.


Everywhere it is referenced, however, the name A behaves exactly the same as (const int *).


For example if we have:


int A[5];


int *p;


We can say p = A; but we can't say A = p;


We can say A[3], and we can say p[3]. No difference.


Furthermore we can do pointer arithmetic with p because we told the compiler what type of critter p can point to --


*(p+3) = 1;


AND you can do pointer arithmetic on A (as an rvalue)...


*(A+3) = 1; -- same thing, see? A+3 == %26amp;(A[3])


Now some tricky stuff. If you think about it, p is an array you can move. It is like int p[] - where you know how big each element is, but not how many elements there are.


Let's assign:


p = A+3; ...so p points to A[3] ... p = %26amp;(A[3])


... p[0] is the same variable as A[3]
Reply:look this sample program below


as you are aware *ch is used to denote a string or is a pointer to a string


** is a pinter to an array of strings





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


int main()


{char *my,**mc, *names[]={"anil","antony","afsal"};


my="Sam";





mc=names;


printf("%s\n",my);printf("%s\n",*mc++)...


printf("%s\n",*mc++);


printf("%s\n",*mc);


printf("Hello world\n");


return (0);


}





my is a string array


%26gt;mc=names;


**mc is pointer to an array of strings the *names[]


%26gt;*mc++


*mc++ will pint to the next element on the string array *names





hope it is clear now

hydrangea

Using C++: Is there a way to make this program a user defined number of names to be entered and sorted???

//Sort an array of 3 names


#include %26lt;iostream%26gt;


#include%26lt;string%26gt;


using namespace std;


void swap(string %26amp;n1, string %26amp;n2)


//receive strings n1 and n2, exchange


{ string temp;


temp=n1;


n1=n2;


n2=temp;


} //swap





void main() //input 3 names, sort, print


{ string names[3]; //3 names: [0],[1],[2]


int index;


for(index=0; index%26lt;3; index++)


{ cout%26lt;%26lt;"enter a name: ";


getline(cin,names[index]);


} //for loop


if (names[0]%26gt;names[1])


swap(names[0],names[1]);


if (names[1]%26gt;names[2])


swap(names[1],names[2]);


if (names[0]%26gt;names[1])


swap(names[0],names[1]);


for(index=0; index%26lt;3; index++)


cout%26lt;%26lt;names[index]%26lt;%26lt;"\n";


} //main

Using C++: Is there a way to make this program a user defined number of names to be entered and sorted???
//do this:


int nint;


cin%26gt;%26gt;nint;


string names[nint];


// and this


for(index =0;index%26lt;nint;index++)


{


//etc.
Reply:Uhm, are you asking is there a way to create a user defined data type? I don't think there is a such thing as a "user defined number" or what you said... Unless you are asking if there is a way to call that whole segment of code using a function with in a class? Or perhaps by using a structure.... I am not really to sure on what you are asking. Please try and be more clear so people can help you :)


Using C is it possible to create an O(1) container if the keys of the container are not pointers?

By creating a hash map of pointers to data one has created a O(1) container but if the hash map is of a C data type there must be a search for the key before this key can be resolved into a value. This search cannot run in constant time in any manner I've been able to figure out. Help would be appreciated.

Using C is it possible to create an O(1) container if the keys of the container are not pointers?
Yes, it's possible, but you have to choose an algorithm based on your data and how you want to store it. For instance, you can have a hash function that instead of calculating a pointer, calculates the indice of an array, and store all the data in an array, ie:





f("John Doe") = 7, f("Jane Doe") = 14





These aren't pointers, but are instead indices of an array. Just watch out for collisions. Check out the diagram on wikipedia.


Run a program using C/C++?

I can't get it to run using system("start program.exe");

Run a program using C/C++?
Don't include "start" - it's a command understood by only by cmd.exe.





Just do:





system("program.exe");





or, if you want to start it asynchronously or have to use "start" for any reason:





system("cmd /c start program.exe");
Reply:system("program");


don't need exe either i thnk


Saturday, May 22, 2010

When using c++ i need an example code of a broken string?

like what it is for example 1,2,3,4,5ive is what i have seen in examples but i dont under stand how a string can brake and y it brakes and if possible an any 1 explain y using globle varibles is so bad

When using c++ i need an example code of a broken string?
You need to slow down.





Learn English first (no offense - or ask this question in a forum that is in your native language), then take basic class on C programming before going into C++.

hawthorn

How can we access the vdu memory through a c program without using functions.?

i saw one question that to write a program for changing capital letter to small and small to capital by using vdu memory but it should stop the moment when user hits a key from the keyboard. i tried but it is not executing. this question is from LET US C book at 255 pg.no.

How can we access the vdu memory through a c program without using functions.?
This program changes the capital letter to small and vice versa but only if


there is a 'character'. so first type something to command prompt, dont use


clrscr() in the program after declaration and run it.





otherwise





try following

















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


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


void main()


{


int a,b,i,r,c,ch;


char z='a';


char far *s;


clrscr();





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


for(b=0;b%26lt;79;b++)


printf("%c",z); //for filling the screen.





while(!kbhit())


{


for(r = 0; r%26lt;=24; r++)


{


for(c = 0; c%26lt;=79; c++)


{


s = 0xB8000000 + r*160 + c*2;


if(*s %26gt;= 'A' %26amp;%26amp; *s %26lt;= 'Z')


*s = *s+32;


else


{


if(*s %26gt;= 'a' %26amp;%26amp; *s%26lt;='z')


*s = *s -32;


}


}


}


}


}


Program using c++ (switch case statemant)?

Write a program to print the given Number in Words using Switch case statement. The


Program has to accept only numbers from 0 to 9. It has to display wrong input for other


values.


Example


Input Output


4 Four


5 Five

Program using c++ (switch case statemant)?
This is a Quick 'n Dirty C# Console App, but I'm sure it can be ported to C++ with little difficulty.








using System;


using System.Text;


using System.Text.RegularExpressions;





namespace MyProgram


{


class Program


{


static void Main(string[] args)


{


Console.WriteLine("Please enter a number between 0 and 9: ");


string input = Console.ReadLine();


Console.WriteLine("You entered " + NumToString(input));


Console.WriteLine("\nPress Enter key to exit.");


Console.ReadLine();


}





private static string NumToString(string number)


{


try


{


switch (int.Parse(number))


{


case 1:


return "One";





case 2:


return "Two";





case 3:


return "Three";





case 4:


return "Four";





case 5:


return "Five";





case 6:


return "Six";





case 7:


return "Seven";





case 8:


return "Eight";





case 9:


return "Nine";





default:


return "a number that was not between 0 and 9";


}


}


catch


{


return " a non-numeric value!";


}


}


}


}
Reply:if this is homework than do it yourself.





If this isn't then you're using a really stupid algorithm. Simple division and modulus operations can give you a much better output although thats still not the best way.





You could just use that atoi function or strtol.


Need some code samples and sample projects in C# ASP.NET using XML?

Need some code sample projects in C# ASP.NET using only XML, XSL,XPATH..(no database usage like SQL,ACCESS,ORACLE)


Also i need to know is ther any free tool available tat maps XSL,XML to PDF..if u know pls let me know..ofcoz with code samples also..plssss

Need some code samples and sample projects in C# ASP.NET using XML?
XSL / XSLT Composer - is an open source tool for creating and testing XSL documents. Sources are available so you can also use it as code example.


Link: http://www.codeproject.com/tools/XSLTCom...





Here are a lot of examples for XML in .Net too


http://www.codeproject.com/soap/#XML


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

C programming only pls.

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





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





Hope that helps

marguerite

Using C++ Write a program that prints 1 2 3 4 on the same line using 3 different methods...?

1)using 1 output statement with one stream insertion operator..





2)using 1 output statement with 4 stream insertion operators..





3)using 4 output statements....

Using C++ Write a program that prints 1 2 3 4 on the same line using 3 different methods...?
cout %26lt;%26lt; "1 2 3 4";





cout %26lt;%26lt; "1 " %26lt;%26lt; "2 " %26lt;%26lt; "3 " %26lt;%26lt; "4";





cout %26lt;%26lt; "1 ";


cout %26lt;%26lt; "2 ";


cout %26lt;%26lt; "3 ";


cout %26lt;%26lt; "4";
Reply:printf("Do your own homework!\n");
Reply:am working on it pls promise i'll get the vote of best answer
Reply:Huh - the answer above me was 28 minutes ago and nothing yet...





1) cout %26lt;%26lt; "1 2 3 4/n"





2) cout %26lt;%26lt; "1 " %26lt;%26lt; "2 " %26lt;%26lt; "3 " %26lt;%26lt; "4/n";





3) cout %26lt;%26lt; "1 ";


cout %26lt;%26lt; "2 ";


cout %26lt;%26lt; "3 ";


cout %26lt;%26lt; "4/n";





Wow - this is so basic that if you don't know this by this time in the semester, you're going to be really lost a month from now!


How can I access a file from one p.c to another using networking?

I connect to p.c one is using xp home and the other is using xp professional I networked them using their lan card with a crossover cable we can share the printer but I'm having a problem accessing the files from one computer to another an accessed denied dialog box appears? what is the problem?

How can I access a file from one p.c to another using networking?
Simple way for accessing the files is put the file folder in sharing mode. For this you have to open the explorer and right-click the mouse on the file folder. Click on sharing and put it in enable mode.
Reply:In the network settings you have to allow the files to be shared between computers.

tropical flowers

How to down load Audio c d songs on computer (C D made using Nero express)?

I made my own audio cds by using Nero Express from the songs on my computer


Now i want to download the songs on my new computer


but it downloads only the shortcuts of the songs so I have to put in the C D in the drive to listen a particular song


Is there a way to actually download the songs

How to down load Audio c d songs on computer (C D made using Nero express)?
this is a no-brainer anymore. pick a program and it is almost guaranteed that it does cd ripping. roxio, real jukebox, itunes and even microsoft's windows media player 9 can do this. just query yahoo for cd rip mp3 for additional info... try and pull a couple of tutorials on how to go about getting this to work if you don't have experience working with computers... or ask your 10 year old. They will be of great help since they've never known a world which didn't have CD's. they never knew that CD player programs weren't always free and they know how to do stuff you and I have probably never even thought of doing.
Reply:You got to send your tunes to its own file that plays wave files. And make sure you have the right recorder on your pc that see these files a waves and not just short cuts. If it can play them it can see them! Oh does your new PC have VISTA OPP SYS IN IT? IF IT DOES HAHAHAHAHA!!!!! NOT.GOOD LUCK


Study the sequence of numbers and create the C-language program (using iteration) for the proper sequence of 2

Study the sequence of numbers and create the C-language program (using iteration) for the proper sequence of 2 numbers entered by the user. If the number is zero, the user will be asked to enter again.


Sample:


Enter 2 numbers: 5, 10





5 15 24 32 39 45 50 54 57 59 60





total: 440

Study the sequence of numbers and create the C-language program (using iteration) for the proper sequence of 2
I do not have a C compiler. Still I am suggesting a pseudocode.





do


{


input two numbers i1 and i2;


if (i2 %26lt; = 0 )


{print " the second number should be greater than zero";


loop;


}


i3 =0;


while (i2-- %26gt; 0)


{


print i1;


i1 += i2;


i3 += i1;


}


}


while ( i1 %26gt; 0)


print "total : ", i3;


end;





I hope you can adapt this to C, else you can email me;


Calculate the pressure exerted by 0.5000 mol N2 in a 10.000 L container at 25.0°C using the ideal gas law.?

I'm getting 1.22 atm. What am I doing wrong. Is it a problem with my significant figures or what.

Calculate the pressure exerted by 0.5000 mol N2 in a 10.000 L container at 25.0°C using the ideal gas law.?
P = nRT / V





P = (0.5000) (0.08206) (298) / 10.000





Your 1.22 looks fine to me, maybe even use 1.223 for your answer
Reply:hmm..i keep getting the same answer so im not sure.
Reply:I get the same thing, and your significant figures are correct as well. Perhaps your answer key for the problem is wrong.


Girlfriend broke up with me b/c she is using meth and didnt want to bring me down Should i tell her dad?

she is beautiful and sweet. however she said we couldnt be together anymore, b/c she had issues and said i was too good and nice to be around her. She finally told me that the issue is that she is using meth. That stuff is hard core, she will get really screwed up if she doesnt stop. She wont let me see her or talk to her. Should I tell her dad or one of her family members so i know she will get help???

Girlfriend broke up with me b/c she is using meth and didnt want to bring me down Should i tell her dad?
seems like she cared for you enough to let you go, if you cared that much for her I think you wont let her go down. Her life is headed in a downward spiral and you might be able to get her the help she needs. But be aware that she may never forgive you for it. You will be able to live with yourself though.
Reply:yes---meth is awful stuff and it will tear her apart if she keeps using.
Reply:She wont be sweet and pretty for long unless you tell someone. WARNING: She will hate you for it but its the right thing to do.
Reply:Yes you need to tell someone because you may be saving her life, even though she will be mad at you but in the long run it will be worth it.
Reply:You should tell someone, she might hate you for a while, but she'll be thankful when she's not six feet under.
Reply:Stop her, tell her dad. But nicely, you dun want her dad to think you are telling tales as she broke up with you. But yes, she might hate you, but you be sorrier if you dun stop her now.
Reply:If you care alot for her the best thing is to tell one of their familiy members because meth is very dangerous and very 1# drug that people cant leave and its hard to stop meth





she will be mad at you at first but later she will thank you


later





the sooner u cure or stop meth the sooner she will be cured and in good hands
Reply:Tell someone now. She may nto like it but she needs help and the only way she is going to get it is with support from family and friends. Try looking for information on Meth Rehabs in your area to give them. They may be shocked and upset, or they may have known in the back of their minds but not wanted to come to terms with it.





http://www.stopmethaddiction.com/
Reply:Tell her dad no matter what-if u dont, she will keep using meth, and have a horrible life and relationships-if u act now, she will get in trouble, but its better than being high and mental and homeless and all those bad things. So if u want a healthy girl, tell her dad
Reply:Yes.

sound cards

Is it true on an '01 C-5 Vette using Mobil 1, that it is only necessary to do an oil change every 15,000 miles

I own a 2001 C-5 corvette and I am under the impression that because I am using Mobil ONE synthetic oil, that it is FACTORY RECOMMENDED that an oil change only needs to be done every 15,000 miles or so, or when the on dash computer says "oil life" is around 40 % . Any of you motor heads know "THE REAL TRUTH" about this ???

Is it true on an '01 C-5 Vette using Mobil 1, that it is only necessary to do an oil change every 15,000 miles
here's the truth. Yes synthetic oil is a much better oil and corvette requires it because of temperature. A vette sits very low to the ground and therefore doesn't get much air flow to cool the engine. As far as the interval anything more than the owners manual recommends is to much. Most manuals will suggest 3000k miles to 7500 miles regardless of what type of oil you are using. The myth about synthetic oil is terribly wrong. It still has the same additive packages as conventional oils. Do you know that those additives are designed to do? They trap dirt like little sponges. Once each additive is full it cant take on any more dirt and the dirt moves on to the next additive. Well synthetic or not your engine still takes in the same amount of dirt in the intake so no matter what oil you use it still wears out the additives just as quick. the oil itself never breaks down synthetic nor conventional it just gets dirty and the additives get used up. so do yourself a big favor and go by the owners manual and not this crazy 15000 mile thing. That is a awesome car and is not a cheap one either so make sure you put some money into maintenance to keep t nice.
Reply:ya but its realy not good for the pressure under the pistons and can over heat the block and crack the heads
Reply:It is true, but if you beat on your car a lot you should probably change it at about 60%. The cleaner your oil is the happier your car is. :)
Reply:Yes. Truly synthetic oil only needs to be changed around 15,000 miles. I still replace the filter with an additional quart of oil at least every 6 months, depending on how spirited she's driven. You can't go wrong with the 'smell' test. If the oil is black and smells like unburnt gasoline, it's time for a change no matter how many miles.





The key is 'truly' synthetic. There are many quasi synthetics out there, which is only a percantage synthetic. Usually around 33 or 50 percent.





And yes, a Corvette motor was built with a little more care than the other small blocks. ie, tighter tolerances.
Reply:no that's long time,,i own a repair shop in Tennessee and you can go as far as 8 thousand on a good oil change with synthetic oil,but who ever said 15 was a little wrong on this one,i use it in all my cars including my hemi challenger and i change it around 8 thousand in all my vehicles,good luck i hope this help,s.
Reply:That seems a bit long to me. There's nothing magical about a Corvette engine or Mobil synthetic oil. I'd change it at least every 5,000 miles.
Reply:dont go more then 8,000 miles.synthetic oil is good but it can only do so much. You should however change the filter after about 3500 because it is not made to go that long.
Reply:I am mechanic and for me the mobil one is the best oil ,,,the 15000 is the limit in the oil i recommed changed every 8000 ,,,because always is better change the fluids before the limit ,,,,that`s my opinion,,,bye.
Reply:there is no way in hell i would wait 15000 miles before i changed my oil in any car no matter what it says especially in a high output engine your gambeling if you do even 5000 seems like alot i know these new oils are supposed to be better but the fact is that there are still some impuritite in the oil that can scar or damage things like cylinder walls rings guides