• Post Reply Bookmark Topic Watch Topic
  • New Topic

why nothing is showing after i compile this C program?  RSS feed

 
jin Otanashi
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what i'm trying do is to test this utmp program using the linux terminal,  I already compile the code and  after i run it nothing is showing .
here is part of the code that i'm trying to test:

 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

There just isn't enough in that code snippet to answer your question. It is just part of a struct with two arrays.  And a line of code that returns zero.

Henry
 
jin Otanashi
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
There just isn't enough in that code snippet to answer your question. It is just part of a struct with two arrays.  And a line of code that returns zero.

Henry


ok i see
 
jin Otanashi
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jin Otanashi wrote:
Henry Wong wrote:
There just isn't enough in that code snippet to answer your question. It is just part of a struct with two arrays.  And a line of code that returns zero.

Henry


ok i see


there is anyone way can know what those thing do?
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jin Otanashi wrote:
there is anyone way can know what those thing do?


Well, it would help if you posted some valid C code -- preferably code related to the part that is supposed to "show" stuff, but isn't.

Henry
 
Campbell Ritchie
Marshal
Posts: 56578
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I shall add you to our C forum, but we can only give an answer if we know what your code looks like.
 
jin Otanashi
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Tim Moores
Saloon Keeper
Posts: 4035
94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That piece of code doesn't output anything, even after adding the minimally required number of characters to make it compile. So, again:

Henry Wong wrote:it would help if you posted some valid C code -- preferably code related to the part that is supposed to "show" stuff, but isn't.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
asked another, way...What exactly would you expect that to print out? What line says to you "THIS is the line that would print something to the screen"?

Based on what you posted, what I see is (and to be fair, I have not done any C programming for 20 years):

You declare a structure
You return the value "0" to the calling program/operating system, and we have no way to know what that does with that 0.

nothing there says "print something to the screen" to me.
 
jin Otanashi
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the thing that i expect to print out is the linux logging name of  each person using the unix computer by that I mean the wtmp file. Yes, I forgot to put the line that would print something to the screen. e.g this what i expect the print out to be :

$ last
Username       
sam             
joe 
...
blah blah           

 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jin Otanashi wrote:the thing that i expect to print out is the linux logging name of  each person using the unix computer by that I mean the wtmp file. Yes, I forgot to put the line that would print something to the screen. e.g this what i expect the print out to be : 


Just pointing out the obvious, but you have still *not* provided "the [code] line that would print something to the screen"... so, obviously, we can't answer your question.

Henry
 
Ron McLeod
Bartender
Posts: 1603
232
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Related this this topic.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!