help with some c home work

This is a discussion on help with some c home work within the C Programming forums, part of the General Programming Boards category; Any help from anyone would be awesome. #1: In C, please write code to determine the longest consecutive bit string ...

  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    1

    help with some c home work

    Any help from anyone would be awesome.

    #1: In C, please write code to determine the longest consecutive bit string (1 or 0) in an array of bytes.

char string[] = { 0xff, 0xa0, 0x00, 0x01, 0xff, 0xff, 0xaa };

int longestBitString(/* you define input */)
{
 int length = 0;

 /* add here */

 return length;
}



    #2: In C, please write a function to sort a singly linked list by odd & even numbers. All odd numbers should appear at the beginning of the list. E.g. original ‘val’ of link list: 1,2,3,4,5,9,5,1; a right answer would be 1,3,5,9,5,1,2,4, or 1,1,3,5,5,9,2,4

typedef struct node
{
 int val;
 node* pNext;

} node;

void sortByOddEven(node **ppList)
{
}

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,824
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    That weird Java guy xniinja's Avatar
    Join Date
    Jun 2010
    Posts
    230
    If you have code we would love to help you, but we won't hand homework to anyone.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem in accessing root home folder....
    By Bargi in forum Linux Programming
    Replies: 1
    Last Post: 02-13-2008, 05:50 AM
  2. Why don't the tutorials on this site work on my computer?
    By jsrig88 in forum C++ Programming
    Replies: 3
    Last Post: 05-15-2006, 11:39 PM
  3. C++ software for home work
    By rgk44 in forum C++ Programming
    Replies: 12
    Last Post: 02-15-2006, 04:00 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21