|
I still have one error in this code and it's the following:
57 no match for 'operatr >>' in 'std::cin>> 2.8273...
and then 22 errors that are exactly the same
std:basic_istream<_CharT, _Traits>& std::basic_istream<chart, _traits="">::operator>>
Do you know what this means?
Sorry for asking again. I asked this last question to the instructor and he hasn't replied. The lab is already late.
#include<iostream>
#include<string>
using namespace std;
void pause(void);
#define PI 3.1415
int main(void)
{
cout << "\n\nThe area of a circle with a 6 inch diameter is: ";
cin >> 3 * 3 * PI;
pause(void);
return 0;
}
Melissa
|
|
|
|
|
Hi Melissa,
cin has to pipe into a declared variable; in the example you've posted, it's piping into an actual number. In that example though, it looks like you're just trying to write out what the diameter of a circle is though - so you'd change the cin to a cout.
cin is used like this:
int main(void)
{
int someValue;
cout << "Enter a number: ";
cin >> someValue;
pause(void);
return 0;
}
------------
Cheers,
Patrick
|
|
|
|
|
Thank you very much, Patrick. Now it's compiling without any problems. Oh, and I'm just now realizing that I posted my question in the wrong place- I thought the # meant any and all C question- whoops!
Thanks again.
Melis
|
|
|
|
|
No problem
wertyou wrote: Oh, and I'm just now realizing that I posted my question in the wrong place- I thought the # meant any and all C question- whoops!
Good thing you did! I don't usually go over to the C++ forum so I'd never have seen your question!
Come back soon!
------------
Cheers,
Patrick
|
|
|
|
|
Hi
1. How to enable internet explorer's "Disable script debugging option" thru code?
Is there any API which will do this operation, if so, Please give me some example code
2. Also I am doing design document update for my code, I am in need of putting class diagram and class description. I could able to create class diagram from VS studio, but i am not able generate class descriptions (like variable_name type modifier description) for all the variables,properties and functions. I can able to see those details by right click on the class diagram and class view details, but it is not allowing me to copy all the details at a time. But i am able to copy one at a time. Is there any simple way to get all class description as like as shown in class details window. (I am working in C#). so that i can copy and paste it in the document. ( i very much required this, because i have 100s of classes and its variables )
sry 2nd is repeated qn., where nobody replied for that
Thanks
srini
|
|
|
|
|
1 - Do you mean C# code, in a client side app, or javascript through a web app ? The former may be possible.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
yes. thru C# code, it is windows application not web..
Thanks
Srini
|
|
|
|
|
hi,
My problem is that my boss told me he didn't want to everytime add a new row to datagridview he must provide new values for new row's cell. Actually. in an added row, only one or two cell need changing values, others are unchangeable. He did want to copy an existing row and paste as new row as well as change the needed values without appearing errors
I tried to use getClipboardContent() method to manually add values of an existing row to a new row but its not working. I think everybody here could help me solve this by showing me how to copy a gridview row and paste as a new row without errors or suggest me a new way to solve this. Thanks in advance
[my code]
string[] str;<br />
private void copyToolStripMenuItem_Click(object sender, EventArgs e)<br />
{<br />
DataObject obj = dataGridView1.GetClipboardContent();<br />
str = obj.GetText(TextDataFormat.CommaSeparatedValue).Substring(1).Split(',');<br />
}<br />
<br />
private void pasteToolStripMenuItem_Click(object sender, EventArgs e)<br />
{<br />
try<br />
{<br />
DataGridViewRow dgvRow = dataGridView1.Rows[0];<br />
for (int i = 1; i < str.GetLength(0); i++)<br />
dgvRow.Cells[i].Value = str[i];<br />
dataGridView1.Rows.Add(dgvRow);<br />
}<br />
catch (Exception ex)<br />
{<br />
MessageBox.Show(ex.Message);<br />
}<br />
}
It seem to be a solution or an answer.
|
|
|
|
|
Plz help me....
I want to append two or more WMV Files in C#... How can i do that????
aLi
|
|
|
|
|
Google the WMV file format. You'll need to extract the data from both files and append them together with a new WMV header.
|
|
|
|
|
hi
i have an app that work with Sql server 2005 Database,for insert to it i used Stored Procedure as "sp_AddToPersons" and use this code to insert action :
SqlConnection con = new SqlConnection(Properties.Settings.Default.ExpressDBConnectionString);<br />
SqlCommand cmdInsert = new SqlCommand();<br />
cmdInsert.CommandType = CommandType.StoredProcedure;<br />
cmdInsert.CommandText = "sp_AddToPersons";<br />
cmdInsert.Connection = con;<br />
<br />
SqlParameter p1 = new SqlParameter("@personName", this.txt_name.Text);<br />
SqlParameter p2 = new SqlParameter("@personFamily", this.txt_family.Text);<br />
SqlParameter p3 = new SqlParameter("@personTel", this.txt_tel.Text);<br />
SqlParameter p4 = new SqlParameter("@personAddress", this.txt_address.Text);<br />
<br />
cmdInsert.Parameters.Add(p1);<br />
cmdInsert.Parameters.Add(p2);<br />
cmdInsert.Parameters.Add(p3);<br />
cmdInsert.Parameters.Add(p4);<br />
<br />
try<br />
{<br />
if (con.State == ConnectionState.Closed)<br />
con.Open();<br />
<br />
cmdInsert.ExecuteNonQuery(); <br />
}<br />
catch (SqlException se)<br />
{<br />
MessageBox.Show(se.ToString());<br />
}<br />
finally<br />
{<br />
if (con.State == ConnectionState.Open)<br />
con.Close();<br />
cmdInsert.Dispose();<br />
}
but the table in my database was not update and don't insert to it, how to solve my problem ?
|
|
|
|
|
I don't see anything obviously wrong with that code. What about the code of the stored procedure?
Also, you should avoid naming stored procedures starting with "sp". This is because SQL Server has a number of stored procedures beginning with sp and if you call one it will look in the master database first and might ignore your stored procedure. At least, that was the case with previous versions of SQL Server.
|
|
|
|
|
Colin Angus Mackay wrote: Also, you should avoid naming stored procedures starting with "sp".
Actually "sp" works fine, but "sp_" is the special prefix that is used for system procedures. Starting a procedure name with "sp_" does not only risk a name conflict with the system procedures, it will also prevent caching of the execution plan for the procedure. The database looks for a cached execution plan for the procedure in the master database, and as it doesn't find it there, it will always be recompiled, eventhough there might be a cached execution plan in your database.
---
single minded; short sighted; long gone;
|
|
|
|
|
I'm using FileSystemWatcher class to be notified upon any change in the file system of my server. But I wonder how I can obtain the information about the user that made the change. Any idea?
|
|
|
|
|
You don't. The FSW doesn't supply that kind of information.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
i dont think FileSystemWatcher can do that
Keshav Kamat
India
|
|
|
|
|
Well is there any other way to get the information I need?
|
|
|
|
|
In a WinForm if you create different BindingSources based on related tables in a DataSet, each time you create a new row in the child BindingSources the relationship key(s) value(s) are automatically entered in the child rows. This works really good.
My problem is I would like to be able to edit the key(s) in the master row.
If I do this then the child rows have no values created for the key(s) they take the value of null.
Is there a way to change the behaviour of the child BindingSources for them to take the new key(s) value(s)?
Is this even possible?
Thanks in advance for any ideas I am running out fast!
|
|
|
|
|
Hopefull that this helps someone in the future, all I had to do is EndEdit() on the master BindingSource!
A bit stupid from my part or was I
|
|
|
|
|
I'm thinking ahead, and wonder if anyone knows how a Type property is handled by its designers/typeconverters (if any)? What I'm hoping is that the designers/typeconverters for a Type property will allow entering the String class name of the type, and translate that to an underlying type field, f_MyType:
protected internal Type f_MyType = null;
public Type MyType
{
get
{
return f_MyType;
}
set
{
f_MyType = value;
}
}
TIA,
mike
|
|
|
|
|
Never tried it. I would suggest trying it real quick with a PropertyGrid. If it doesn't work, it shouldn't be too tough to write a custom type converter for that. I'm guessing it won't work, but shouldn't take much to test that.
|
|
|
|
|
Actually, I'd be tempted to write a type converter and maybe a UITypeEditor implementation that shows possible types to choose from.
|
|
|
|
|
Hello
http://www.computerworld.com/action...ticleId=9012149
May someone explain about "SendMessage API call"?
Thanks
Reply With Quote
|
|
|
|
|
Help me!! How to code by C#
Input: 3 matrix 2 dimension(values: R G B from image file)
Output: EZW
Thanks!!
ok
|
|
|
|
|
This is a google question, you need to find articles on the algorithm you want to impliment. What does it do ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|