![]() |
|
#1
|
|||
|
|||
problem printing outputIam reading in a 4row 3column table.
Iam refering to char_function[4][3] in the following code.This is a part of a larger program. You can neglect all other things and look at char_function my aim is to print it out CPP / C++ / C Code:
why is the output showing only the last column of the table?? puzzeled, arjun |
|
#2
|
|||
|
|||
|
Quote:
You have an array of char. Output using cout<< assumes an ascii char. If you want to print the ascii for 0 or 1 using cout<<, you can cast the output variable to an int. Regards, Dave |
|
#3
|
||||
|
||||
|
Or use an int definition instead of char
Also, your for() loop would be easier to read if you reformatted it to CPP / C++ / C Code:
__________________
Cow: You're a lawyer too? Mooseblood (mosquito): Ma'am, I was already a bloodsucking parasite. All I needed was a briefcase! |
|
#4
|
|||
|
|||
|
Hi,
I have one more problem now. For the same assignment I need to generate a table of the following king a b c.. x1 x1 x3.. 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 . . . 0 0 0 1 1 1 0 0 1 0 0 0 0 0 1 0 0 0 . 0 0 1 1 1 1 and so on. I've shown it for three variables a , b , c (could be more-say k; k is fixed and three variables x1, x2, x3(could be more-say upto xN. I am using arrays to store this as both its dimensions are fixed. The a,b,c need not always go till (1 1 1).Which means that the number of rows for 3 (k)variables a,b,& c may be less than 8 (2^k) Plz help me out , The submission is in 15 hrs , so its a bit urgent. |
|
#5
|
|||
|
|||
|
formatting ate up all the spaces I had given
I've filled them with underscores a b c..__ x1 x1 x3.. 0 0 0 ____0 _0 _0 0 0 0 ____0 _0_ 1 0 0 0 ____0 _1 _0 . . . 0 0 0 ____1_ 1_ 1 0 0 1 ____0_ 0_ 0 0 0 1 ____0_ 0_ 0 . 0 0 1 __1_ 1_ 1 and so on. |
Recent GIDBlog
Toyota - 2008 July Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Printing problem | Frandy | MS Visual C++ / MFC Forum | 1 | 16-Feb-2005 13:47 |
| Apache / PHP problem, maybe output length? | HaganeNoKokoro | Apache Web Server Forum | 2 | 08-Sep-2004 07:22 |
| using vector or array | oshiotse | C++ Forum | 4 | 16-Apr-2004 10:59 |
| urgent: problem + output filters | jack | Apache Web Server Forum | 0 | 04-Feb-2004 22:32 |
| articles -> output | Allowee | Learning Journal by J de Silva | 1 | 05-Jun-2003 19:47 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The