gets Questions
3
Solved
Here's the description of gets() from Prata's C Primer Plus:
It gets a string from your system's standard input device, normally
your keyboard. Because a string has no predetermined length, get...
7
Solved
I'm trying to use gets() to get a string from the user, but the program seems to be passing right over gets(). There is no pause for the user to give input. Why is gets() not doing anything?
char n...
13
Solved
When I try to compile C code that uses the gets() function with GCC, I get this warning:
(.text+0x34): warning: the `gets' function is dangerous and should not be used.
I remember this has so...
Telford asked 7/11, 2009 at 18:55
5
Solved
The condition is:
I want to input a line from standard input, and I don't know the size of it, maybe very long.
method like scanf, getsneed to know the max length you may input, so that your inpu...
2
Solved
I am having trouble or am confused with an rspec error when running:
rspec -fd game_spec
(the above is only the beginning of a long eror message)
When I run it without the -fd, it works... b...
3
Solved
I am trying to write a program that will ask the user to answer a question using gets.chomp in three seconds or the answer will automatically return false.
I figured out everything except for the ...
3
Solved
Coderbyte is an online coding challenge site (I found it just 2 minutes ago).
The first C++ challenge you are greeted with has a C++ skeleton you need to modify:
#include <iostream>
#inclu...
Tai asked 20/3, 2019 at 20:0
3
I am new to C programming (although I have experience with Java). After reading some tutorials, I decided to start solving coding challenges on Coderbyte.
The first challenge I tried was this...
Philous asked 17/4, 2018 at 6:52
10
Solved
I am using the function gets() in my C code.
My code is working fine but I am getting a warning message
(.text+0xe6): warning: the `gets' function is dangerous and should not be used.
I want th...
10
Solved
If the code is
scanf("%s\n",message)
vs
gets(message)
what's the difference?It seems that both of them get input to message.
1
Solved
I was about to write a shell with C language. Here is the source code below:
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <sys/wait.h>
#include <s...
Shooin asked 13/8, 2017 at 3:26
1
Solved
I am new to Buffer Overflow exploits and I started with a simple C program.
Code
#include <stdio.h>
#include <strings.h>
void execs(void){
printf("yay!!");
}
void return_i...
Chefoo asked 10/6, 2017 at 4:2
8
Solved
I'm pretty new to C, and I have a problem with inputing data to the program.
My code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
int a;
char...
2
Solved
I have been told that scanf should not be used when user inputs a string. Instead, go for gets() by most of the experts and also the users on StackOverflow. I never asked it on StackOverflow why on...
3
Solved
I've been testing this struct out and I get warning about using gets. Somebody mentioned to use fgets instead and replace the end with '\0'. Any recommendation how I can change my code to do that? ...
3
Solved
The gets() function has been removed from the C language. No such function exists in the standard.
Yet I compile the following code:
#include <stdio.h>
int main (void)
{
(void) gets (NULL...
Rogue asked 3/6, 2015 at 12:12
5
I'm reading lines of input on a TCP socket, similar to this:
class Bla
def getcmd
@sock.gets unless @sock.closed?
end
def start
srv = TCPServer.new(5000)
@sock = srv.accept
while ! @sock...
2
Solved
I understand that an 'implicit declaration' usually means that the function must be placed at the top of the program before calling it or that I need to declare the prototype.
However, gets should ...
7
I've been doing a fairly easy program of converting a string of Characters (assuming numbers are entered) to an Integer.
After I was done, I noticed some very peculiar "bugs" that I can't answer, ...
4
Solved
What is the difference between fgets() and gets()?
I am trying break my loop when the user hits just "enter". It's working well with gets(), but I don't want to use gets().
I tried with fgets() an...
4
Solved
Using the IRB, I want to enter a multiple line string in order to strip certain characters from it. "gets" only allows a single line - is there a similar function for multiple lines.
ASCII_project...
5
Solved
Every C programmer knows there is no way to securely use gets unless standard input is connected to a trusted source. But why didn't the developers of C notice such a glaring mistake before it was ...
Niobium asked 2/8, 2013 at 1:34
5
Solved
Based on the most recent draft of C++11, C++ refers to ISO/IEC 9899:1999/Cor.3:2007(E) for the definitions of the C library functions (per §1.2[intro.refs]/1).
Based on the most recent draft...
Unsavory asked 14/9, 2011 at 22:19
2
I was wondering why when I'm trying to gets to different inputs that it ignores the second input that I had.
#!/usr/bin/env ruby
#-----Class Definitions----
class Animal
attr_accessor :typ...
2
Solved
I need to get user input when running a .js in a console with spidermonkey like this:
$ js myprogram.js
What's the JavaScript equivalent of Ruby's gets?
Dangerous asked 30/4, 2013 at 19:20
1 Next >
© 2022 - 2024 — McMap. All rights reserved.