I am having trouble in reading my full name in just a single variable and some kind of authentication. this is my code by the way.
Code:
#include <stdio.h>
int main(void)
{
char NAME_MINE1[40];
void clrscr();
}
[code]....
if i enter my full name i will be able to go on to the next statement/command but when i put on some name (which is not mine) i will automatically get an error and exit the program.If i type "Qwerty You Tube" EXACTLY and not just the first string before the whitespace i will be able to proceed but when i enter "Qwerty Tube You" or "Qazse Qop Queen" i will get an error and the program will exit.
I thought maybe there was something in C that could read full sentences from stdin
Code: scanf("%100[^ ]s", string);
But that's not working for me. so i came up with my own function and its not giving me the results i want. here is the function including the call from main:
Code: /* * * * * * * * * * * * * * * FROM MAIN * * * * * * * * * * * * * * */ printf(" Adding a new part... "); printf("Enter part name: "); get_string(new_part.pname);
Where is the eight coming from? i thought fpurge clear the buffer. Also, I'm trying to add spaces in between words... i thought maybe putting within the while loop but outside of the if statement string[length +1] = '' would work, but it doesn't. so i put it outside of the loop but that i knew that wouldnt work either.
Problem #2 is reading from a file.. so far i have the following code which reads everything perfectly except the .txt file has a new line character at the end and i think its reading it:
0 in stock i want it to stop after reading the ball bearings line. a lot of issues for one post, but all related to reading inputs so i put it all on one.
i recently started programming. i mean I've been exposed to programming for the first time about a week ago. I've been following the tutorial here and playing around with my own code. For some reason, this code works while receiving decimals but not fractions.
Code:
#include <stdio.h> int main() { float kd; float kd_2; printf("Please enter your k/d "); scanf("%f", &kd ); }
I'm still having troubles connecting multiple clients to my server.To break down what I have going:I have a server that is supposed to accept multiple clients.. Currently, It works with one person.While the server is running, One person is allowed to play the game (While connected to the server). If the server is down, the player cannot play (This shows that the server and client responde and work).
However, While the server is running and the client joins, the first player is allowed to play. Everyone else's window goes black and says "Not Responding" (Like any other game in which isn't working).While these players are in "Not Responding", It still says the client has connected onto the server (But they're not able to play?).My client code is working perfectly, But i'm having troubles accepting multiple clients onto my server.
#include <iostream> #include <winsock2.h> #include <vector> #include <process.h> #include "Included/pthread.h" //Some things i'm using or will be using in the future
My problem is that I've created a Client and Server program in which they communicate. The Client is an SDL Application that allows you to play as a movable character IF YOU ARE CONNECTED TO THE SERVER. If not, You're unable to play. THIS WORKS!
However, Only one client is able to play on my server?? Anyone elses' window freezes and they are not allowed to play (As if not connected to the server). Here is my server code.
I have a code to check the last time modification of a file using "gmtime". Is it possible to remove the seconds in the result?
Here is my code:
struct tm* clock;// create a time structure struct stat attrib;// create a file attribute structure stat("test.txt", &attrib);// get the attributes of afile.txt clock = gmtime(&(attrib.st_mtime));// Get the last modified time and put it into the time structure
Why is this code not marking that the queue is full.. I'm just including my Add function that verifies if they want to add another number to the queue. The isFull function works fine, have used it on other programs.
template <class T> //Template currSize function int Queue<T> :: currSize () { return (rear - front + arraylength) % arraylength; //
[Code].....
The output goes all the way down to 1 spot left, lets the user enter the last element. Then it asks if they want to add another.. At this point, when they hit Y, it lets them add it and it says there are 5 spots left!
I wanted to make my program read the file "input.txt". I did it successfully, but now I want to get the full path of the file "input.txt". Is there any way to do it?
I'm trying to design a C program that ask the users to type their full name (seperate by a space), and store this name in a two dimensional array. I just want to test if I did it correctly, so i just entered one name and give it a try.
char name[50][2]; printf("enter the neame"); scanf("%s%s",&name[0][0],&name[0][1]); printf("%s",name); return 0;
but the program will not print the expected result.
But I don't know how to this. I could have done this without pointers with if statments but I want to do it with pointers because it were a exercise to do.
So, I'm making a program in C++ that emulates a full screen console... I used SetCurrentConsoleFontEx to set the font to 12x16 but it sucks...
Anyway, I read here: [URL] .... that also the console font can be changed, but I can't make it work! How can i set the font to Lucida Console? This is the function I use to change font size:
The program is not showing my full menu just the 0 Exit and the last line of text. This is the full main source file (not implementation file or header file).
The problem I am facing is that I have to output the C++ input file and display every line of code in the output, except in the output I have to convert every if, else, and while as IF, ELSE, WHILE. I tackled the first part and now its onto the 'easier' part even t
How can I check if window media player is running in full screen mode & topmost in c++ MFC?
What I used is this logic:
I compared media player full screen coordinates to that of monitor coordinates.If they are same implies media player is in fullscreen.But it has one flaw.Whenever there are control(for play,pause) displayed in full screen in media player, coordinates are not coming same as that of monitor.
How do I read a .pdf file using C++? When I try to open it using myfile.open ("example.pdf"); but all I see is some Crazy Symbols. Is there any way to open ?
I am building a program that will read from a particular web page. I have written it so that it will parse the page correctly, but I can only do it for a downloaded page right now. I would like for it to work simply with the URL.
I have seen things about "screen scraping", though I don't quite understand what it does - I think it's more for just parsing it, which I can already do.
If it is possible to automatically download that file, that is fine as well.
If it matters at all, the pages I am reading from are stories on Fanfiction.net.