Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Ignoring optimization, I would say code 2 is minutely faster because it doesn't have to initialize the inner loop as often as code 1. Other than that, they are both the same.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The easiest way to answer your question is to just compile and run the program on a *nix computer.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

char* name is a pointer, while char name[] is illegal because it is attempting to create an array of 0 elements. Some compilers may support declaring arrays with 0 elements, but that is an extension of the standards. It's quite dangerous to use non-standard constructs because that makes the program itself non-standard and may not compile with other compilers. If you instructor or someone else wants to compile your program with another compiler it mahy fail.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Homework? A prototype tells the compiler about a function such as its return value and parameters. Function prototypes are required if the function has not been previously defined. For example

void foo(char* s)
{
    printf("%s\n", s);
}

int main()
{
   foo("Hello");
}

In the above snippet a function prototype for foo() is not needed because the compiler already knows about the function when it is called from main()

However, in the snippet below a function prototype is required because the compiler knows nothing about the function foo() when it is called from main().

 void foo(char* s); // function prototype

int main()
{
   foo("Hello");
}

 void foo(char* s)
 {
     printf("%s\n", s);
 }
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Which part of your assignment don't you understand? Do you know how to create an array? Do you know how to get user input? You need to post the code that you know how to write then ask about what you don't understand. Asking us to write the program for you won't teach you anything.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

After booting with Ubuntu 12 Live fdisk reported "GPT (GUID Partition Table) detected on /dev/fdb. This fdisk doesn't support GDT. Use GNU Parted". That's probably why it doesn't recognize the partitions when I try to install ubuntu. I'm reluctant to use GNU Parted for fear it will destroy Windows partitions.

I wanted to boot with Ubuntu 13 live but it said it couldn't find Live on the disk.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Yes, I like that color better -- red looked as if something was wrong.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

What does that red flag represent, the one next to the word "Featured" beneath my avatar???

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Yes rain is good because I don't have to watter the gras. But this is a Noah-like rainstorm! The ground is already so wet that it cannot absorb any more water so it all just runs into ditches and floods the streets.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I've been trying all day to find a way to duel boot Windows 8 and Ubuntu. None of the google links I read seem to work on my computer.

My computer has two internal hard drives, Widows 8 is installed on the first drive c:. The second hard drive has two partitions, one for use with Windows while the other partition is where I want to install Ubuntu. The links I have read say it's quite simple, just tell Ubuntu to use the partition I want. But neither Ubuntu version 12 or version 13 recognize the two partitions on the second hard drive, instead it wants to take over the entire hard drive. I have a lot of files on the second hard drive that I can not let Ubuntu delete.

I can't use the Utuntu Windows Installer because it is not compatible with Windows 8. Any suggestions on how to make Ubuntu recognize the two logical volumes on the second hard drive?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

We had one big big rain storm an hour ago-- lots of flooding everywhere (not mhy home though). I was out driing in it and water up almost to the top of the tires of my car. Just got the internet back a few minutes ago. I think vegaseat sent his rain over to my direction (I'm a few hundred miles east of Las Vagas)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

what antivirus program are you running? What api functions does it use?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

didn't you read the tutorial I provided???

To do it manually would I have to make a purchase?

No.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Those are called arrays. AFAIK yes, you can create arrays of buttons or other controls.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You need to get a resource editor.

If you want to create it manually, here is a popular tutorial.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

yes

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

what kind of program do you have? win32 api or Windows Forms (which is c++/CLR, not c++ standard). There are hundreds of ways to do what you asked, post some code to show us what you are trying to do.

If your program is win32 api then function A() needs to pass function B() the HWND handle of the textbox, or function B() returns a pointer to a string to function A() so that A() can populate the textbox.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The pointer itself is passed by value, any changes you make to the pointer in reverse() is not visible to the pointer that was declared in main(). I ran your program and it looks like it works as expected.

If you want reverse() to change the pointer that's declared in main() then you have to pass it by address like this: reverse(&str) Then declare in in reverse like this: void reverse(char**str) But doing that will be disasterous because main() wouldn't be able to use the pointer any more and a memory leek will occur because main() can't delete[] it either.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

license plates are publically available -- anyone anywhere can track them. You have no right to privacy when in your car on public roads. If it's visible from outside the car then there is no privacy violation. Big Brother is not going to watch you unless you give him a reason to watch. It doesn't bother me in the least that the government tracks the movements of criminals/terrorists, in fact I would help the government do that if I could.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Maybe this is what you are asking?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

If this is your first job and applying for entry level position then don't be overly concerned about your technical skills. Companys don't expect you to be expert for entry-level job. Have you finished your college bachelor's degree yet? That, along with the other things Jorge mentioned are what you should concentrate your efforts on. I decided not to hire one person because of lack of social skills not because of technical skills. You have to be able to work well with others and accept gratiously the critizem of your work from your peers becuase there will be peer review of the code you write.

iamthwee commented: nods +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Got it all fixed now -- I removed that Attachments column from the db. After that, the next problem I encountered was "concurency error" when I attempted to update a second time. I found the solution to that one by refreshing the grid after update which apparently forces the dataset to flush itself. I only mentioned this just in case someone else has a similar "concurency" problem.

   Private Sub btnUpdate_Click(sender As Object, e As EventArgs) Handles btnUpdate.Click
        Me.data_adapter.Update(CType(Me.binding_source.DataSource, DataTable))
        data_table.Clear()
        data_adapter.Fill(data_table)
        MessageBox.Show("Database Updated")
    End Sub
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Oh, looking at the table with MS Access one of the columns is a list of 3 items. I used MS Access to add a row in the table, then tried to update it with my program -- update works. Insert a new row into the table doesn't work (An INSERT INTO query cannot contain a multivalued field). Anyone know a work-around?

[edit]Googling around a bit I see that is a common problem with newer versions of MS Access -- it's apparently the only one in the world that uses multivalued fields. Too bad that is such a problem with VB.NET. Guess I'll just get rid of that field.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Here is the app.conf file. This is for MS Access 235 (2013 for cloud), attached is the MS Access file.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
    </configSections>
    <connectionStrings>
        <add name="MyContactList.My.MySettings.MyContactsConnectionString"
            connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=E:\Users\Melvin\Documents\MyContacts.accdb"
            providerName="System.Data.OleDb" />
    </connectionStrings>
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
</configuration>
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I tried the suggestion that scudzilla posted and it still doesn't work after resetting the db back to it's oritinal state with spaced in column names. Update still fails.

Public Class Form1
    Dim binding_source As New BindingSource()
    Dim data_table As New DataTable()
    Dim data_adapter As OleDb.OleDbDataAdapter
    Dim sql As String
    Dim cb As OleDb.OleDbCommandBuilder
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.DataGridView1.DataSource = Me.binding_source
        Dim conString As String = My.Settings.MyContactsConnectionString
        Dim con As New OleDb.OleDbConnection(conString)
        con.Open()
        data_adapter = New OleDb.OleDbDataAdapter("SELECT * FROM Contacts", con)
        cb = New OleDb.OleDbCommandBuilder(data_adapter)
        cb.QuotePrefix = "["
        cb.QuoteSuffix = "]"

        data_adapter.Fill(data_table)
        binding_source.DataSource = data_table

    End Sub

    Private Sub btnUpdate_Click(sender As Object, e As EventArgs) Handles btnUpdate.Click
        Me.data_adapter.Update(CType(Me.binding_source.DataSource, DataTable))
        MessageBox.Show("Database Updated")
    End Sub
End Class
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I did read the link before I posted -- your problem might be on your computer or your internet provider. I'm in USA and almost never have a problem that is caused by DaniWeb (maybe once a year or so).

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Tried mememove, will this actually work?

Not the way you coded it.

Whatever you do you need to make sure there is enough room in s to hold all the characters you want.

I think you will do better if you could show an example of what you are trying to do. Example:

Orignal string = "Hello World"
String to insert = "My"
Result = "Hello My World"

With that you can see you need to move "World" to the right in the array by the length of the "String to insert". So you will need three memmove's

  1. determine length of the string to be inserted.
  2. determine where to insert the new characters
  3. move all the characters from the position found in #2 above right by the number of characters in the string to be inserted.
  4. copy the new characters into the string
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

so I can use it in a web request?

How does that relate to the code you posted? Why would you want to put random characters in a web request (URL??)?

Use a temp buffer.
1. copy the first part of the string into the temp buffer
2. Add all the randome characters
3. Add the remainder of the original string

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Don't hold your breath for that kind of change.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You woudn't have all those problems if you used a REAL computer instead of that stupid wii.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

IE10 -- no problems.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

That, and replace "void main" with "int main" and use cin instead of fscanf. There's nothing else different between C and C++ in that program.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Problem solved: I repalces the spaces with '-' and SQL doesn't like that either. I just removed the space altogether and now everything is ok.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

line 19 does the insert -- data_adapter.Update() does all that. It does INSERT for each row in the DataGridView that is not in the dataset that was read from the database, and UPDATE or DELETE for the others.

[edit]I removed the spaces in column names, deleted all rows, and attempted to add two new rows via the DataGridView -- now it produces syntax error in UPDATE statement!

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I have a program with DataGridView which is bound to MS Access table. When I addept to update I get "Syntax error in INSERT INTO", but no explanation about the syntax error. Column names in the table have a space in them, such as "Last Name". Could that be the problem? Most of this code comes from a tutorial I'm studying.

Public Class Form1
    Dim binding_source As New BindingSource()
    Dim data_table As New DataTable()
    Dim data_adapter As OleDb.OleDbDataAdapter
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.DataGridView1.DataSource = Me.binding_source
        Dim conString As String = My.Settings.MyContactsConnectionString
        Dim con As New OleDb.OleDbConnection(conString)
        con.Open()
        data_adapter = New OleDb.OleDbDataAdapter("SELECT * FROM Contacts", con)
        Dim cb As New OleDb.OleDbCommandBuilder(data_adapter)

        data_adapter.Fill(data_table)
        binding_source.DataSource = data_table

    End Sub

    Private Sub btnUpdate_Click(sender As Object, e As EventArgs) Handles btnUpdate.Click
        Me.data_adapter.Update(CType(Me.binding_source.DataSource, DataTable))
        MessageBox.Show("Database Updated")
    End Sub
End Class
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Only if the message was intended for the child. It's all in the HWND parameter of the message.

What can't you solve? Can you embeed IE into the window? Or doesn't IE work when it's like that?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

To go back to Form4 from Form5 just close Form5 -- you don't need to create a new Form4 because it's already in memory.

private: System::Void btnBack_Click(System::Object^  sender, System::EventArgs^  e) {
     this->Close();
 }
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

hint -- you should upgrade to fee vb.net 2012 express

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Here is one suggestion from StackOverflow -- use sed shell program. Put the text in a file then run sed against it as shown in the example in that link.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You don't need a gun to live so this is an incorrect comparison.

You will if you live in St. Louis, Missouri or Washington D.C.

You people only hear about high crime rates in the big cities of America. There are millions of people living without fear all over the country, living in small towns and rural areas. I am one of them -- the town where I live has a population of about 2,000 and the only crime we have had since I moved here in 1979 is kids playing pranks on Halloween. I don't even lock the doors of my home when no one is home for a few hours or when I am sleeping. And I list just a few miles outside of St. Louis, which has one of the highest crime rates in US.

On Thomas Jefferson Quotes

"No free man shall ever be debarred the use of arms. The strongest reason for the people to retain the right to keep and bear arms is, as a last resort, to protect themselves against tyranny in government"

-- Thomas Jefferson, 1 Thomas Jefferson Papers, 334

(At the time that was written America had large slave trade, "fee man" generally referred to white people, not black slaves, although there were a few white slaves too.)

The people of the various provinces are strictly forbidden to have in their possession any swords, short swords, bows, spears, firearms, or other types of arms. …

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Nobody but me is allowed to make mistakes here! Anyone else is just banned :) (just kidding)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

That is VB.NET not C. Wrong forum.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

One way to do it is like below. I'd also put the number of elements in each array into the combined structure so that you know how big the arrays are at runtime.

typedef struct _elems {
    int a;
    int b;
    int c;
}elems;

typedef struct _elms {
    elems *e1;
    elems *e2;
    int e1Size;
    int e2Size;
} earray;

static elems eArray1[]={{5,9,13}, {12,22,1}, {2,3,4},{4,3,1}};
static elems eArray2[]={{23,121,55}, {88,23,90}};

static earray e = {eArray1, eArray2, sizeof(eArray1)/sizeof(eArray1[0]), sizeof(eArray2)/sizeof(eArray2[0])};

int main()
{
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I would use a temporary char array -- after you find the beginning of the string to be replaced copy the first part of the original string into the temp array, copy the replacement string into the temp buffer, then finally copy the remainder of the original string

Maybe a little more efficident way is to just copy the string that is past the part to be replaced into a temp buffer, for example if you have "The quick brown fox" and you want to change "brown" to "red", copy " fox" into a temp buffer. Next truncate the original string at the beginning of the string to be replaced -- in this example it will become "The quick ". Copy the replacement string into the end of the original string -- making it "The quick red". Finally, copy the contents of the temp buffer back to the end of the original -- "The quick red fox". Of course you should use strcat() to do the actual string contatinations.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The .NET browser control is NOT an activeX control but will probably require IE8 or newer. If you need to support older browsers then it's probably not an option you can use.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Why do adults like watching cartoons? That's all anime is -- just another name for children's cartoons.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

It's not how tv shows reflect reality that's important -- it's the entertainment that is important. If tv and movies had to be reality shows then there would be very few shows to watch. I don't watch a lot of tv any more, maybe a few epesodes of Law and Order SVU and Judge Judy.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

This article may give you some hints to how you can do it. It creates a splitter window with a tree-view in the left side and something else in the right side. Maybe you can embed IE in one of the two sides. Here is how to embed an IE browser in a program. It is quite complicated so be prepared to learn a lot of COM programming.

It will be a lot easier if you use C++/CLR which is for .NET so that you can use it's browser control.

Unimportant commented: Solid post +4
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Can you set up a "IT Equipment/Software For Sale" forum, something similar to Creg's List or Angie's List, but probably limited to IT related stuff? You already have a Webmaster Marketplace, but that is very limited.