Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
176 views

In what I've tried to make the simplest of examples, I don't get any output from a puts() to the Rails console or to the development.log when ranges#ranges is hit. The ranges.html.erb is rendered as ...
Bob Rockefeller's user avatar
-1 votes
3 answers
115 views

I am trying to understand how puts function works in standard C. I read that it prints a specified string to the standard output and appends a newline character to this string. However, I get ...
RaduV's user avatar
  • 1
1 vote
1 answer
528 views

# include <stdio.h> # include <stdlib.h> #include <string.h> void main (void) { int size, i,j; printf("enter no. of employee\n"); scanf("%d", &j); printf(&...
vatsal's user avatar
  • 81
3 votes
3 answers
310 views

I've embarked on learning to program in C. I've started reading Seacord's Effective C book, and I've got confused already on page 6=D Earlier in the book, there is this little program which he calls ...
rokamama's user avatar
  • 115
1 vote
3 answers
64 views

What is the difference bw puts("Odin") and puts "Odin"? Context puts "odin" || true gives different result than puts("odin") || true
koil's user avatar
  • 49
0 votes
2 answers
75 views

#include<stdio.h>` int main() { char b[1]; scanf("%s",b); puts(b); // gets(b); // puts(b); // gets(b); // puts(b); return 0; } output: hello_world hello_world I ...
Gagandeep Singh's user avatar
1 vote
2 answers
84 views

Can anyone please explain to me why my code doesn't run when I have my second elsif statement in. I'm sure it's something simple but I've been over it a few times, wrote out the code again and still ...
goatstash's user avatar
  • 162
1 vote
0 answers
48 views

What puts() does in C? What does it do in the buffer, and what happens to its arguments? For example, when puts() is passed a string, does puts() send all the strings to the buffer? If a value in a ...
yida wu's user avatar
  • 19
7 votes
1 answer
4k views

please explain it to me that what is the dfference between puts(string name) and fputs(string name,stdout) both of them have the same output especially when I use fgets(string name,n,stdin) for get ...
S MEHDI M's user avatar
0 votes
2 answers
334 views

#include <stdio.h> #include <string.h> struct employee { char ename[20]; int sal; }; struct employee accept(struct employee); void display(struct employee); void main() { ...
Aditya Bachu's user avatar
0 votes
2 answers
91 views

#include <stdio.h> #include <stdlib.h> #include <pthread.h> #include <sys/time.h> #include <unistd.h> #include <string.h> #define size 5 void *displayName(void *...
Michael's user avatar
1 vote
1 answer
2k views

thank you for read my question. When i debug puts function in glibc, I found something which couldn't understand. // glibc-2.27/libio/ioputs.c int _IO_puts (const char *str) { int result = EOF; ...
leesh's user avatar
  • 131
0 votes
2 answers
967 views

I have written a Travel App with Tour Items and I'm trying to display the order at the end. When I use puts @order_items I get {"SevendaySurfSportTour"=>2} for two tours. I would like it ...
Devbreaker29's user avatar
0 votes
4 answers
295 views

Currently I'm following this pdf on C pointers. The code below was meant as a demonstration but confused me beyond belief. Firstly, my understanding of pointers to arrays is that they are initialized ...
user avatar
0 votes
1 answer
1k views

I'm new to writing in Ruby and I have this assignment for my Programming Languages class where I have to implement Mergesort into Ruby such that the user can enter an array of their own choice of ...
DjMaxLETU's user avatar
0 votes
1 answer
143 views

I' trying to get a value of variable, which name consists of string "a" and iterator "i" (in this short example I skipped for loop). I was trying to do it with concat and append, ...
Featurea's user avatar
0 votes
2 answers
384 views

So, I've started to try to learn c (I came from python) and one of the things I used to learn python was to try to make tic tac toe in python. For this reason, I thought I might as well try to make ...
CarcaPo1's user avatar
0 votes
1 answer
1k views

The C standard provides two functions, puts and fputs, with puts(s) behaving as fputs(s, stdout) except that it additionally appends a newline: The puts() function shall write the string pointed to ...
vitaut's user avatar
  • 57.3k
1 vote
2 answers
835 views

So I'm slowly continuing learning C. And now, I have a task, to read data from a file and sort it. File data: House naming 1 30 300 House naming 2 45 450 ....... House naming 10 5 120 So, first ...
Alexey Kozlov's user avatar
0 votes
1 answer
387 views

I'm currently in the process of learning ruby, and I don't know if I'm doing something wrong or the compiler is, but this code: puts "Name?" name = gets puts "Welcome " + name Outputs: #blank line ...
oguh43's user avatar
  • 85
2 votes
6 answers
2k views

I have to print in shell the description of my error, and I can't access to the element inside an object inside an array and I'm still learning Ruby. I've tried rescue => e puts e.fields[...
AFAF's user avatar
  • 609
2 votes
2 answers
1k views

I have got the following Ruby hash: hash = { 0 => " === @@@ @ @ @ @ @ @ @@@ ===", 1 => " = @ @ @ @ @ ="} I would like to print out some of the values of the hash in one line in the console. To ...
franciscofcosta's user avatar
1 vote
0 answers
72 views

I have a function as below: int fun() { puts("hello"); return 10; } int main() { printf("%d",sizeof(fun())); return 0; } I want to ask why when I call sizeof(fun()) it just return ...
Hồng Phúc's user avatar
0 votes
2 answers
546 views

I wrote this piece if code below to read a text file that says: It was the best of times, it was the worst of times, it was the age of wisdom. When I run my code nothing seems to happen. Is there ...
Ollie Parsons's user avatar
0 votes
3 answers
86 views

I have been trying to solve a problem, Everything works fine, except that the required string is not getting printed #include<stdio.h> int main() { int test,i,number,num1; char ch; scanf("%d",&...
Mohit Singh's user avatar