DeanMSands3 69 Junior Poster

@rproffitt: The way I'd see doing that is setting up an ad-hoc Wifi network from the device that the app connects into. I think the Amazon Echo does that.

DeanMSands3 69 Junior Poster

Background: I'm looking to program and sell (on the Mom & Pop circuit) some internet-enabled devices. They need to be pre-configured in-store by a non-techie. The device will come online with a DHCP address. I need to find it, send it customer-specific configuration changes, then wrap it up for the customer. The project manager knows that the target demographic will likely not want the hassle of making changes to the product after the initial config.

OK, so I have a device with an auto-IP that I need to SSH into. To my limitied knowledge, I can do this in two ways:
A.

  1. Ping-scan against the network (yuck)
  2. ARP the MACs for a very-specific manufacturer.
  3. Scan for a specific open port setup for unconfigured devices.

B.

  1. (Unconfigured target device is running multicast listener service)
  2. Send multicast message, asking for target's 'eth0' address.

After I know where it's at, my program will SSH in with a preconfigured key and send a config script.
I know how to do A not so much B, but I'm sure I can figure it out in an afternoon.
What do you recommend, DaniWeb?

DeanMSands3 69 Junior Poster

Finally deleted $Windows.BT and the Creators Update went through. Laptop seems to be working fine now.

DeanMSands3 69 Junior Poster

rproffitt: There are prior discussions about this. Example where they went with an in-place upgrade:
https://www.tenforums.com/performance-maintenance/23170-sfc-corrupt-files-2.html

Which is a great idea except I was stuck in the Recovery Console. I ended up copying some known good files from the WinSXS folder to clear up the CSI Payload Corrupt errors. Couldn't figure out the manifest errors.

For some reason the Windows Boot Manager wouldn't boot from a USB so I tried enabling it from BIOS. Hilariously, the USB didn't boot but Windows finally did.

I'm still wrestling with it. Now I'm trying to get the Creators Update, but it keeps failing. DISM and SFC both report success. The Update Troubleshooter reported success then failure. Now I'm going for an in-place upgrade.

rproffitt commented: I'm staying tuned. +0
DeanMSands3 69 Junior Poster

So I went through https://support.microsoft.com/en-us/help/4013429 and finished downloading the MSUs from http://www.catalog.update.microsoft.com/Home.aspx . I'm going to try the Cumulative update first then try patching one at a time.

Let's see what happens.

rproffitt commented: Paramedics. The first people you see after "Hold my beer. I'm going to try something." +12
DeanMSands3 69 Junior Poster

I have my suspicions on how to fix this, I just want to make sure I'm right.

dism /image:C:\ /cleanup-image /restorehealth /scratchdir:C:\Scratch /Source:WIM:C:\Source\Install.wim:2

From my DISM log.

(p) CSI Manifest Corrupt            x86_microsoft-windows-c..dtc-runtime-cluster_31bf3856ad364e35_10.0.14393.953_none_7434ed91724916c9
Repair failed: Missing replacement manifest.
(p) CSI Payload Corrupt         amd64_microsoft-windows-c..sktop.appxmain.root_31bf3856ad364e35_10.0.14393.1358_none_50bc92cd091f5c0a\Cortana.LocalSearch.dll
Repair failed: Missing replacement payload.
(p) CSI Payload Corrupt         amd64_microsoft-windows-c..sktop.appxmain.root_31bf3856ad364e35_10.0.14393.1358_none_50bc92cd091f5c0a\Cortana.IntentExtraction.dll
Repair failed: Missing replacement payload.
(p) CSI Payload Corrupt         amd64_microsoft-windows-c..sktop.appxmain.root_31bf3856ad364e35_10.0.14393.1358_none_50bc92cd091f5c0a\Cortana.Dss.BackgroundTask.dll
Repair failed: Missing replacement payload.
(p) CSI Payload Corrupt         amd64_microsoft-windows-c..sktop.appxmain.root_31bf3856ad364e35_10.0.14393.1358_none_50bc92cd091f5c0a\Cortana.Nodewinrtwrap.dll
Repair failed: Missing replacement payload.
(p) CSI Payload Corrupt         amd64_microsoft-windows-n..orking-connectivity_31bf3856ad364e35_10.0.14393.1066_none_a8485c0b80ebb5de\OnDemandConnRouteHelper.dll
Repair failed: Missing replacement payload.
(p) CSI Payload Corrupt         amd64_microsoft-windows-n..orking-connectivity_31bf3856ad364e35_10.0.14393.1066_none_a8485c0b80ebb5de\Windows.Networking.Connectivity.dll
Repair failed: Missing replacement payload.
(p) CSI Payload Corrupt         amd64_microsoft-windows-classpnp-minwin_31bf3856ad364e35_10.0.14393.953_none_487cf0798b3b556f\Classpnp.sys
Repair failed: Missing replacement payload.
(p) CSI Payload Corrupt         amd64_microsoft-foundatio..ostics-errordetails_31bf3856ad364e35_10.0.14393.0_none_36927aa70a1e0894\ErrorDetailsUpdate.dll
Repair failed: Missing replacement payload.
(p) CSI Payload Corrupt         amd64_microsoft-foundatio..ostics-errordetails_31bf3856ad364e35_10.0.14393.0_none_36927aa70a1e0894\ErrorDetails.dll
Repair failed: Missing replacement payload.
(p) CSI Payload Corrupt         amd64_microsoft-desktop-p..ioning-platform-uap_31bf3856ad364e35_10.0.14393.0_none_a641fa67da8fc706\countrytable.xml
Repair failed: Missing replacement payload.

C:\Source\Install.wim is a known good 14393 WIM from installation ISO. This is Home edition so I'm using Index:2.

My suspicion is that I should be able to patch the WIM with the MSU updates and try the DISM again. Any thoughts, DaniWeb?

DeanMSands3 69 Junior Poster

Trying to pipe data into FINDSTR, but I'm getting whole lines and not the matching substrings. Have I asked this one before?
Let's say the data takes the form of

BLAH BLAH BLAH BLAH
BLAH BLAH "GOOD UNIQUE DATA"
BLAH BLAH BLAH BLAH
BLAH BLAH "SLIGHTLY DIFFERENT GOOD UNIQUE DATA"
BLAH BLAH BLAH BLAH
BLAH BLAH "MORE GOOD DATA"
BLAH BLAH BLAH

I only want the good data substrings and not the BLAHs.

EDIT: Every. Single. Time. Solution found: https://stackoverflow.com/questions/40780784/findstr-return-only-a-regex-match

SECOND EDIT: For informational purposes, I'm trying to find the most recent Volume Shadow Copy from VSSAdmin while in the Recovery Console. I'm at this point right now:
vssadmin.exe list shadows /for=C: |FINDSTR /E \\\\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy.*

DeanMSands3 69 Junior Poster

Disclaimer: I am not a VB.NET programmer nor do I have any experience with TWAIN or WIA.

Twain vs WIA
http://developer.dynamsoft.com/dwt/kb/2739

TL;DR: Twain is better for scanners and requires a vendor dialog, WIA for cameras with a standard dialog.

Your printer/scanner can do both.

Here're some useful links I found for VB.NET.

http://www.vbforums.com/showthread.php?639523-VB-Net-scanning-from-Twain-Driver

http://www.planetsourcecode.com/vb/scripts/showcode.asp?txtCodeId=1551&lngWid=10

DeanMSands3 69 Junior Poster

A client needs a Windows Server set up.
The Server will run Exchange.
The client will have a max of 10 employees.
At most one user will ever need to remote-desktop in.
How many User CALs will need to be purchased and what kind?
Should there be 10 User CALs for the Windows Server, 10 User CALs for Exchange and 1 RDS CAL?

DeanMSands3 69 Junior Poster

Well, you clearly don't have pygame.

Open a command line.

CD AppData\Local\Programs\Python\Python35-32
pip install pygame
exit

Try again.

DeanMSands3 69 Junior Poster

OK, first, we need to establish your engine. The traditional engine follows something like this:

Setup various media engines (Graphics, Music, Sound)
Read in game objects from disk
Setup game objects in memory

Start clock
Loop until done:
    ThisManyMilliseconds= time since last clock tick
    Read UserInput
    ForEach unprocessed Event:
        Event.Process
    ForEach GameObject:
        GameObject.Update(ThisManyMilliseconds)
    ForEach Layer
        ForEach DrawableGameObject in Layer
            Draw GameObject

GameOver
CleanUp

So, to add a countdown timer, you just do the following:

  1. Create it as a visible game object
  2. Give it the initial value of 30
  3. Subtract ThisManyMilliseconds from the timer
  4. Each tick update the on-screen timer
DeanMSands3 69 Junior Poster

Week-old post is a week-old. Never-the-less!
You can parse CSV's in 3 different ways:

  1. Use a Finite State Machine to parse through the lines. https://stackoverflow.com/a/30338543

  2. Use a RegEx to parse through the lines. (Technically, still an FSM, but smaller.)
    https://stackoverflow.com/questions/18144431/regex-to-split-a-csv

  3. Use a library someone else already wrote. https://github.com/ben-strasser/fast-cpp-csv-parser

Also, a good reference:
https://stackoverflow.com/questions/1120140/how-can-i-read-and-parse-csv-files-in-c

DeanMSands3 69 Junior Poster

OK, I asked a general question and got very general answers. @rproffitt's advice on not reinventing the wheel is quite sensible - but I want to anyway. (Because I can and it's fun!)

Maybe I should elaborate. I'm looking to write a 2D platformer in C++/SFML. I know I'll need to simulate key-presses and mouse-clicks and test if the desired outcome is achieved: did the character move? did he/she not move? I guess was hoping for a little more feedback on people with relatable stories.

DeanMSands3 69 Junior Poster

Test Driven Development is something I explored at my last firmware job. I'm interested in trying it while developing a game-engine. Has anyone else here tried this and what has your experience been.

DeanMSands3 69 Junior Poster

@rproffitt: you're right of course. And I'm still not sure I've got all the settings right. It changed dramatically when I upgraded.

Still recovering from the last freeze. Upon further investigation, it looks like Windows might have been running an upgrade in the background when the machine froze. When I loaded from a Win10 USB, it mentioned an upgrade and asked if I was sure I wanted to continue. I'm running a repair right now.

DeanMSands3 69 Junior Poster

Update:
Updated to Windows Preview. Still freezes.
Updated BIOS. Still freezes but aftermath is hilariously worse with inaccessible boot device errors prompting hour-long Startup Repairs.

Solutions not yet tried but out of reach for now due to low funding:
Physically upgrade motherboard and CPU to something else.
Physically upgrade PSU.

DeanMSands3 69 Junior Poster

In the output scenarios you use printf("%02d = %02d:%02d am\r\n", i, First, Last);
Each %02d tells the compiler you want a two-digit number with leading zeroes.
However, the first %02d in each output line should be %04d since we want a number 4-digits long with leading zeroes.
Try that instead.

Three words on coding style for beginners: (if you believe ignorance is bliss please disregard)

  1. main should always be declared as a int instead of a void. Assuming no errors, return 0; at the end is fine.
  2. getch(); and also system("pause"); at the end of a program are bad form and you'll want to break that habit early on. Put in the return value at the end of main and, once you've learned to use the debugger, set a breakpoint there. This keeps your window open until you're done with it.
  3. Using #include<conio> makes your code "non-portable" (i.e. could break this code on another C compiler on another platform) and is discouraged. Getting rid of the getch(); means you can get rid of #include<conio> .

But most importantly, good luck and have fun coding.

DeanMSands3 69 Junior Poster

Thanks for the contributions, guys.

@ReverendJim: I mentioned earlier that I had both Linux and Windows 8 triple-booted with Windows. Both work fine though with their individual quirks. Some Linux programs will freeze momentarily (like MineCraft), but never the whole OS.

@rproffitt: Pretty sure the cpu is getting good cooling. A new after-market fan is keeping it plenty cool. Might need to look at the timing.

In anycase, two hours into Win10-15046 seems stable (knocks on wood). We'll see.

DeanMSands3 69 Junior Poster

Already done all that. Picked up work as a GeekSquad Advanced Repair Agent when the oil economy tanked. They had an impressive toolset for just that. Believe me; we checked it over good.

If I recall correctly, back before 10586 (November 2015) it was freezing whenever I ran Chrome or MineCraft Windows 10 edition. I didn't really come back to Windows 10 until after 14393 (Anniversary). Windows 8 and Linux have both run solidly enough I didn't feel the need. I haven't been able to nail down any commonalities in the freezes since then.

Things I haven't tried:
Upgrading the BIOS (I'll try that tomorrow)
Breaking the RAIDs (a friend suggested that Win10 has trouble with RAIDs - can anyone confirm this?)

Just joined the Windows Insider Program on the Fast Track. Let's see what 15046 has in store.

DeanMSands3 69 Junior Poster

Trigger Warning: Old specs are old.
This has been a persisent problem for more than a year. Bold items are original parts when issue first noticed. Unbold have been added afterward with no change.
CPU: AMD FX-6300 Six-Core AM3+
FAN: After-market
MB: MSI 970A-G46
RAM: 2x Samsung PC3-8500F, 2x Hyundai PC3-12800
GPU: NVIDIA GeForce GTX 750
PSU: ThermalTake TR2-500W
HD: 3x 2-HD RAID-1 Sets:

  • 1TB:Windows 8x64 Pro
  • 1TB:Data (formerly Linux)
  • 500GB:Windows 10x64 Pro (moving to Insider Preview from Anniversary, but this was a problem before the November 2015 update)
    for 6 drives total w/ additional USB3-connected drives

System randomly freezes and has to be reset. Temperatures that I can monitor look good and stay below 60C.

DeanMSands3 69 Junior Poster

You've got some parenthesis hanging around in suspicious places. Better round them up. Do that by going to each left parenthesis and see where its matching right side is.

One thing I recommend is eliminate a bit of Arrow-Code Anti-Pattern ( https://blog.codinghorror.com/flattening-arrow-code/ ) by getting rid of the easy possibilities first:
If differ is less than 0, you can return right away with the fixedSalary.
All the code after that can safely assume that differ is greater or equal to 0 (meaning the sales person met their quota).

DeanMSands3 69 Junior Poster

tl;dr: Rust looks fun, but it'll take me a while to learn it. Do you think it's worth my time?

So... Rust. As in Mozilla Rust. You know, the one that's not Go, but still wants to be hip and young.

A little disclaimer: From years of firmware brainwashing, I tend to like the "lower" high-level languages like C. Consequently, I find C++ sexy and exotic. Not everyone does, and I get that.

Back to Rust. It looks interesting in terms of execution speed: Benchmarks against GCC . Speed is nice.

The language itself looks alright. I don't do much functional programming, but this seems like a reasonable introduction/refresher-course.

Can't say much for the job market, but who knows what the future holds? (I went to school with a guy who landed a position just for knowing Oz/Mozart b/c what the hell is Oz/Mozart?)

So... I haven't committed myself to taking the plunge just yet. Anyone have any thoughts or experiences they'd like to share?

DeanMSands3 69 Junior Poster

It was called "normal distribution." Who knew?

DeanMSands3 69 Junior Poster

Hi, Daniweb.
I have this hobby project I'm playing with where I need to generate data for a MonteCarlo simulation.

The data needs to fit within a bell-curve around a given mean with a standard-deviation.

I'm trying to figure out which random distribution system I need to use and how to use it.

Disclaimer: It's been at least 3 years since I took Statistics and I barely remember what a Z-score is. Be kind in your replies.

EDIT: Every. Single. Time.

https://msdn.microsoft.com/en-us/library/bb982827.aspx

DeanMSands3 69 Junior Poster

Hi and welcome to DaniWeb!

I think there's some confusion here because I'm not seeing where this would be JSP.

This is a JavaScript function that would run client-side, not server-side.

It uses an ActiveX object, which will only work in Internet Explorer, again client-side only.

This file you're deleting would have to be located on the clients' PC. Are you intending to delete a server-side file?

Permissions in Internet Explorer would have to be set such that this site would be trusted to run ActiveX functions, additionally to modify files on the client machine.

DeanMSands3 69 Junior Poster

Hi, Daniweb, it's been a while.
I'm looking to do a mobile ssh-client (well, not quite a full client) that stores sensitive login information encrypted by a pattern-lock.
However, I know very little about encryption.
Can anyone recommend a good learning path - and by path, I mean Encryption for Dummies followed by Encryption for People Who've already Read the Dummies Book and so on.
From my limited google-searching, I found the Bouncy Castle API and I'm looking into that.
Thanks.

DeanMSands3 69 Junior Poster

What it says on the tin.
Assume that every easily-googled effort to fix Windows 10 has failed and rollback attempts have failed.
Assume I have access to a PE/LiveCD.
Assume that Power -> Shift+Restart -> Troubleshoot ->??? is useless to me.
(This is quite a unique situation!)
Assume that I still have the Windows.old file.
Assume that I really don't want to reinstall from scratch.
With these assumptions in mind, how do I MANUALLY rollback to Windows?

DeanMSands3 69 Junior Poster

This is more or less what I thought I wanted.
http://bach.istc.kobe-u.ac.jp/cream/cream12/docs/sdoc/html4/index_en.html

But now that I consider the exponents and other math oddities inherent in EE, this most likely won't work.

I'm just going to leave this one alone for now.

DeanMSands3 69 Junior Poster

Uh... no. Just no.
For those, I'd use a shunting yard algorithm.
This is a bit more complex.
ide13.gif

What I'm looking for is a library that can read in an equation, parse the relations between the variables and can reverse the relationships so if I give it any set of all-but-one known values, it can calculate the unknown variable.

Now that I've laid out what I'm really asking, it dawns on me that I may as well just hard code all the equation variations in.

Unless someone knows of something better.

DeanMSands3 69 Junior Poster

tl;dr: Looking for a java library to solve equations. Suggestions welcome.

I'm looking to write an app for the sake of writing an app.
I figured that, as a firmware guy with minimal EE hardware training, a good practice app would be one that acts as a helper for EE projects. One of the things I wanted to add was an equation solver for things like Resistor/Capacitor rate of discharge, etc.
But it's not enough to solve for the same variable over and over. I'd like to choose a known function, then be able to plug in the known values and get back the unknown value, whichever variable it may be. Something like http://hyperphysics.phy-astr.gsu.edu/hbase/electric/capdis.html

At first I looked into Functional Programming, but I'm not sure it's the right way to go.
Digging around Wikipedia, I found Constraint Programming (using linear/float variables) which seems close to what I'm looking for but not quite either. It'd be nice to put in an equation once without having to hash through every derivation.

Any suggestions?

DeanMSands3 69 Junior Poster

Also, bear in mind that the iterator (*it) will be pointing to a std::pair<string, PolicyRuleInfo> object within the map. If you only want the PolicyRuleInfo struct, you'll want to use it->second.

DeanMSands3 69 Junior Poster

Simplest way's the best I guess.

DeanMSands3 69 Junior Poster

Hi, Guys.
I'm calculating the correlation coefficient between two HashMaps of Stock Prices keyed on Dates. However, the Dates do not always line up perfectly. So, I need to line-up the two HashMaps by their Keys.

Thus far, I'm creating two ArrayLists of the Dates, doing retainAll between them and then copying over the HashMaps using only the matching Dates.
This probably less than ideal.
If someone has a more efficient way, please let me know.
Help me out, Daniweb.

DeanMSands3 69 Junior Poster

Thanks, guys. I'll try it out.

DeanMSands3 69 Junior Poster

So... this happened at a LAN party. A friend was pestering me for Linux Mint. For some reason YUMI wouldn't recognize my flash drive, so I did it the manual way.

sudo dd if=./linuxmint-17.1-cinnamon-64bit.iso of=/dev/sdb bs=1M

However, it should have been:

sudo dd if=./linuxmint-17.1-cinnamon-64bit.iso of=/dev/sdd bs=1M

It's an ADD/mental auto-pilot sort of thing.

So... the first 1.4G of my 1TB Windows 8.1 drive has been written over with a Linux Mint installer. Before, there was a 100M recovery partition and then the rest was the OS Partition. But now there's only 1 partition: the bloody installer.

I'm fairly certain it's fubar'ed beyond hope with the exception of raw sector reads. I was wondering if any of you had any thoughts or advice on more efficient methods of data recovery before I get started on that.

DeanMSands3 69 Junior Poster

The dead post - !
... It - it lives again! What have you done??!

That which was dead should have stayed dead! The grave will not be lightly robbed her rightful prize.

You fools! You've doomed us all!

DeanMSands3 69 Junior Poster

Aaaaannnddd there's your problem. Everyone give a warm round of applause and +1's to Mike for an excellent response.
However, once again, we ...
I don't even know how to put this gently to the OP:
Don't frakking use Turbo C.
OK, let's qualify that statement with: Don't use Turbo C outside a DOSBox instance, and even then, only use it to explain the history of programming to someone else or for your own personal sick amusement (guilty!).
But for actual programming there are better options and this question has been answered several, several times.

TL;DR:

Stop using Turbo C.
Go get Visual Studio Express or Code::Blocks or the Qt SDK or Orwell Dev C++.

DeanMSands3 69 Junior Poster

tl;dr: I want to write a program to generate 2D graphics for a Metroidvania.

I need to make art for my 2D platformer. I need it to layer well within a parallax engine. I need the tiles to blend well with their neighbors.
But... I have the artistic skills of a brain-damaged hamster.

But I can do math. I can learn L-systems and other fractals. I can write code.

This link describes applying a tilemap to make the tiles nicely together and would work wonderfully in a proceduerally generated tile-map engine: http://www.saltgames.com/2010/a-bitwise-method-for-applying-tilemaps/

And that's great, but I still need to figure out how to make the actual tiles. For now, I'm going to use tilesets I can buy and d/l from OpenGameArt,etc., but I'd like to generate my own. Any thoughts?

I'd need to write code to handle things like rocks, grass, gravel, caverns, etc.

Now that I think about it, Blender has an orthographic projection mode that might work. Anybody know any good tuts for making tiles with that?

Any tuts for anything? Help is appreciated.

DeanMSands3 69 Junior Poster

I can't speak for the vanilla game (which I couldn't care less about), but the modding community is alive and well. (FTB, anyone?) That's what I'm worried M$ will kill.

DeanMSands3 69 Junior Poster

Quasi-Off Topic: Back when I used to haunt Webmaster Talk Forums (yes, that acronym is deliberate on their part) we used to see these posts all the times. I have to say that, even when it was a bot or maybe a proxy account, the help requests on WTF for making malicious code were usually more fun to read than this one.
Legitimate help requests in C/C++ were so rare I gave up after a while and came here.

DeanMSands3 69 Junior Poster

I'm struggling with a side-scroller platformer game engine I'm working on. I want to provide Actors (primarily monsters) with state machines to follow, but I'm worried about how best to implement them.
Right now, Actors extend Entities (I'm still torn on whether passive Entities like items/scenery should have states) and I've created an ActorState class, but my creative thought process ends there.
Some states a monster might have are:
Idle
Wandering
Chasing
Melee Attacking
Ranged Attacking
Taking Damage
Dying

The plan that occurs to me is to create state-machine maps for classes of Actors (like Melee-Non-Flying Monsters, Ranged-Aerial Monsters, etc., etc.) I'm still unsure.
Has anyone here approached this problem and how did you resolve it?

DeanMSands3 69 Junior Poster

Glances over first example
There needs to be a list of variables name you don't use when asking for help in an English speaking forum.

#include<iostream>
#include<string>
#define bilp 5 //Total number of students
//#define saiznama 20 //student name length //Nope. Gonna use strings.
using namespace std;
int main()
{
    //initialization

    int mark[bilp],i,j,k,semen;
    //char nama[bilp][saiznama];
    //char mama[1][saiznama];
    string nama[bilp];
    string mama;
    //input data
    for(i=0; i<bilp; i++)
    {
        cout << "Masukkan Nama[" << i+1 << "] dan juga markahnya : ";
        cin >> nama[i] >> mark[i];
    }
    // (bubble) sorting
    for(i=0; i<bilp-1; i++)
    {
        for(j=i+1; j<bilp; j++)
        {
            if (mark[i] < mark[j]) //TO SORT BY NAMES, THIS LINE MUST BE CHANGED TO COMPARE NAME DATA.
                     {
                     //Swap the grades
                     semen= mark[i];
                     mark[i]= mark[j];
                     mark[j]= semen;

                     //Swap the Names
                     //for(k=0;(mama[0][k]= nama[i][k]) != '\0';k++);
                     mama=nama[k];
                     //for(k=0;(nama[i][k]= nama[j][k]) != '\0';k++);
                     nama[i]=nama[j];
                     //for(k=0;(nama[j][k]= mama[0][k]) != '\0';k++);
                     nama[j]=mama;
                     }
        }
    }


      // output data
      cout << "\n\nNama yang disusun mengikut markah tertinggi adalah:\n\n";
      for(i=0; i<bilp; i++)
              {
                cout << i+1 << " " << nama[i] << " " << mark[i] << "\n";
              }

return 0;
}

OK, so simply by changing the first example to use strings, I all but did your homework for you. You need to change 1 line.
However, this is the C w/classes paradigm. This isn't really C++.
EDIT:
Here's a few examples of what I mean:
http://www.cplusplus.com/reference/algorithm/sort/
http://www.cplusplus.com/articles/NhA0RXSz/ (Look for "Sorting User Made Types.")

DeanMSands3 69 Junior Poster

Made a few more edits. I realized I was failing to initialize the bits variable in BitCount. Then I realized this code would also hang on negative numbers. Not sure how you wanted that handled. I went with casting as unsigned which will give you the "Two's Complement" value.

EDIT:
@Perry31:
Ah. I see.

DeanMSands3 69 Junior Poster

These are tutorials I've used myself.
Sockets: http://beej.us/guide/bgnet/
Threads: http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html
GUI: http://www.yolinux.com/TUTORIALS/GTK+ProgrammingTips.html , http://zetcode.com/tutorials/gtktutorial/
Wordprocessing: For now, just learn to put text into a textbox in GTK+, then save the contents to a file.
MySQL: http://zetcode.com/db/mysqlc/
^This is a good one to have under your belt.^

DeanMSands3 69 Junior Poster

O.O
I... I'm really not sure what to say here.

#include <stdio.h>
#include <stdlib.h>
//Declare prototypes
unsigned int BitCount(unsigned int);
char *BinaryFormat(void*);

int main()
{
    char *binaryString;
    int Input = 0;

    scanf_s("%d", &Input);
    binaryString=BinaryFormat((void*)&Input); //Use reference to Input instead of Input's value.

    printf("\nThe Binary format for the given is : %s", binaryString); //Its no longer crashing here
    free(binaryString); //Clean up after yourself when using dynamic allocation.
}

//
//Coverting the given input to Binary data
//
char* BinaryFormat(void *Input) //Why void*?
{
    char *binFormat = NULL;
    unsigned int num = *((unsigned int*)Input); //Cast Input as Input pointer, then grab referenced value.

    //Counting number of bits needed
    unsigned int bitCount = BitCount((int)num); //This will return number of digits needed. This is separate fn

    //Allocating Input based on number of digit(bit value) needed
    binFormat = (char*) calloc(1,bitCount+1);

    if (num)
    {
        binFormat[bitCount]=0; //As a precaution.
        while(bitCount)
        {
            //Filling binFormat either with 1's or 0's based on number
            binFormat[bitCount-1] = num&1 ? '1' : '0'; //Use '1' and '0'

            num = num >> 1;
            bitCount--;
        }
    }else{
        binFormat[0]=0; //Send back an empty string
    }
    //returning final value as string
    return binFormat;
}

unsigned int BitCount(unsigned int number){
    unsigned int bits=0; //EDIT: Oops. I forgot to make sure this was initialized to zero.
    while(number){
        number >>= 1;
        bits++;
    }
    return bits;
}
DeanMSands3 69 Junior Poster

I wrote the below post, but it felt wrong. So let me say this, go make as many games as you want, but make it a side job. My dad told me never to make your hobby into your career because you will come to hate it. He does electronics. He's one of the best in the business. He wishes he'd went and become a doctor.
(Most of the doctors he's met wish they'd gone into something else, but that's another story.)
So go have fun. But bear in mind it's a rough world out there for creative artists trying to make a living.

I wish for you to make video games and be very happy doing it.

I got this one.
Let me kill your dreams right now.
Game development, according to a grad student I knew while I was finishing my Bachelor's, is a fast way to kill your soul.
And I sort of understand where he's coming from.
Imagine doing what you love, but now add deadlines. Then come customer complaints. Writer's block. Office politics. Low pay. Pleasing investors. Competition from across the globe. Draining every last ounce of creativity from your aching brain. Knowing that ungrateful ___s around the world gorging themselves on consumer entertainment will amuse themselves for a time with your masterpiece then throw it away. Unless something flashier and shinier grabs their attention first, leaving your carefully crafted work of art ignored and untouched.
All …

DeanMSands3 69 Junior Poster

Home router. Actually an access point. It's a Netgear WN3000RNP. I've got it bridged to a wireless N router running DDWRT. And yes, other systems are able to access the Wireless G side including my cell phone which is G only like the laptop.
I'm sure it's something simple, but I can't figure out what.
One thing I haven't tried is running Knoppix on the system and seeing if the Wifi can connect that way. That might take a while though. Any suggestions in the meantime are welcome.

DeanMSands3 69 Junior Poster

I have a Vista PC connecting in through wireless. IP and DNS settings all look good. Google and Yahoo can be pinged, but not accessed via web. FTP does not work either. I have checkde to make sure that no proxies have slipped in.
I noticed similar questions, but those answers haven't fixed it yet.

DeanMSands3 69 Junior Poster

Granted. You're at an important business meeting when...

Finish your Degree from Home!

<close window>

8uy CH34P PR3$C21PT10N M3D$ FR0M C4N4D4

<close window>

LOOKING FOR A BRIDE FROM A COUNTRY YOU'VE NEVER HEARD OF? LOOK NO FURTHER!

<close window>

INCREASE YOUR MANHOOD NOW!

<close window>

Are you sure you want to navigate away?

"I'm sorry I'm boring you. Would you like to sit out the rest of the meeting in my office?"

I wish the above poster had a wireless link between his brain and computers. (I know, that's just cruel.)

DeanMSands3 69 Junior Poster

Did some minor googling and found FreeXFS, conveniently in VC.
https://code.google.com/p/freexfs/

Referenced from: http://en.wikipedia.org/wiki/CEN/XFS#XFS_Middleware