I'm trying to create a simple program that reads in the user's first name, middle name, and last name. Then inside of the userName function, I want it to only take the first letter of firstName, first letter of middleName, and then just output the full last name. So for example: if your name was John Kevin Smith, it would output jksmith. I'm having a lot of compile issues due to the pointers. I have to use the function in this code, so the pointers are needed.
I am trying to create a login that accepts a user login and password. it should accept 3 tries in which when the user enters their username the system should tell whether if the username is correct if not it should display a message saying invalid username and directs the user to register like entering their dob and name. But I cannot seem to get this part run correctly.
#include<stdio.h> #include<conio.h> #include<stdlib.h> #include<string.h> void main() { char userId[10]; char passwrd[10]; int p = 0;
this is really important i searched an example code about "Username and Password Validation between Server and Client" through internet a LOT and i couldn't find anything..
I'm trying to create a piece of code similar to the code I have created on the new username section which will allow me to put certain restrictions on how my new users log in i.e the password length and the the need for a numeric digit. I also need storing my new members details in my previously created array.
case 'N': //Set up new user Console.Write(" Create new Member details "); Console.Write(" Create new Username must be 8 characters, all letters, 1 Capital letter");
I mainly code plugins for Cinema 4D .... I used to code in COFFEE (a javascript like language, only for Cinema 4D) and python. But, recently, I started coding in C++.
I start my development on a Mac, using Xcode. But then, to generate Windows versions of my plugins, I take my source code to Visual Studio, perform the necessary adjustments, and create Win32 and Win64 code.
Lately, I was trying to devise a scheme to protect my plugins from being pirated. Yes, I know it is virtually impossible, but if I could make it harder for hackers to crack my plugins, it would be fine. I made it work fine in python and in C++, but only in Xcode.
In Windows it is difficult. I only need to be able to access a username/password protected folder in my server and check if there is a file there. I don't even need to read the content of the file (but it would be nice to be able to do that too).
I started out using the cURL library but it is so complicated to make it work. I need 32 and 64 bit versions. Then I also have to include three .dll files in the folder of the application (that means that I would have to ask to the people who buy my plugins to copy three additional files to the main application folder... not a good thing )
So, any way to access a username/password protected folder on the net? (the username/password is generated in my code so, of course, I know what are the username/password to provide).
Also, I would need a way for the code to be completely self-contained, meaning that the users would not have to manually add any other files (libraries), besides the folder containing my plugin.
I tried to build a basic username-password verification program; I already have 2 text documents, usr.txt and pass.txt in which username and password are stored. Then have written this program to check the username and password, but every time it says Access Denied.
Everything is working okay with name1 and pass1, but if I try to log in with different credentials, for example name2 and pass2 it says "invalid details"
Here is my code:
string user, chuser; string pass, chpass; string los; ifstream loginData("logindata.txt"); cout << "Please type in your username:" << endl; getline(cin, user);
How do you create a new directory in C++? I would like to do this using the standard library and no external, third party or non standard libraries/headers. I need to do this without calling system() or system("mkdir").
I have a class where I'm trying to create two static maps. I know I haven't separated the implementation from the declaration. This is how I'm required to program at the moment.
My example class that I'm trying to compile looks like this:
#include <map> #include <string> class Foo {
[Code]....
I keep getting compiler errors, though, saying:
invalid use of qualified-name Foo::map1 and invalid use of qualified-name Foo::map2
I can't initialize these maps explicitly; in my real program they're created by reading in a few different files' data on startup. I need to be able to access the maps throughout my entire application, and I don't want to be required to read in the same data file over and over again.
how static maps can be created properly, or failing that explain another methodology I could use to make them available to my entire application?
I want to create a new data type called an inf_t. It's basically infinity (which for C++ is 1.7e+308). The only reason I want this is because I want to overload the cout << operation to print out INF/inf. Should I do this in a struct?
I need starting a do-while loop in my program that runs up to 10 time that asks the user to enter up to 10 scores, which include the slope and rating for the course, and calculates the handicap for each score.
Here's what I have so far:
Code: { //This program calculates a golfers handicap. #include <iostream> #include <string> using namespace std;
I want to build a library using c++ which will serve as an abstraction layer between applications and low-level process. The library will provide some APIs for the applications for some purposes.
For example the low-level process, may send an indication to the library i.e. raise an event, and the library in turns send it to all the applications, which have their registered callbacks to this library.
Any example for the previous scenario in c++ using boost library or the standard library will be perfect in Linux environment? The example that I want is: Generate event from a process and pass it to the library, then let an application register callback to the library.
Initially I know in Linux, I may use signal to send events, but my plan is to have a something more general not tighten to a specific OS.
I am trying to create a border around my program. It looks like this: . I had to read a file in, which is in the attachment and produce the desired output in the image. I have produced the desired output, but without the border.
I have recently begun programming c within my university course. I have been given a task to add arrays to a program I had previously made to make it record the values as I expect I will then quote them on an exported document.
Code:
#include <stdio.h> #include <math.h> main() { int i; // step counter float theta[10000]; // initial value for angle
[Code]....
The pendulum is meant to swing and take gravity into account, then it is meant to loop and record values for the step count, time, theta and omega (mainly theta and omega required). The boundaries are set so once the angle of theta reaches 180 degrees it then stops. I believe the problem lies in the way I have created my theta array, however, I don't properly know how to implement this. Upon launch it asks for omega, as required, after inputting the value it crashes.
how to make the it all work later...but in the mean time how can i get this to display this? Note it has to be made using as a console program. The "Description" and "Cost/ib" collums will be referenced through use of a header file. all else is done by user input and calculations.
I want to create a C library function that i can directly call in my code from any .c file having main program.following are codes...code of library function "foo.c"
Code:
#include "foo.h" int foo(int x) /* Function definition */ { return x + 5; } header file "foo.h"
Code:
#ifndef FOO_H_ /* Include guard */ #define FOO_H_ int foo(int x); /* An example function declaration */ }
[code]....
to use this i have to compile the file in below manner...
Code: gcc -o my_app main.c foo.c
My concern here is that i want to compile the main.c and use function without compiling foo.c with i.e.
Code: gcc -o my_app main.c
any user of this function should only compile his program and should be able to use the function, the foo.c file should remain hidden from him
my system is Linux 2.6.18-308.4.1.el5 #1 SMP Wed Mar 28 01:54:56 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
So, this is the code i have problem with, as far as i can see, function form actually does the same thing that printf does.It probably puts all of the arguments sent to the function together into one string.
I'm currently working on a 2D space shooter game in C++ using SFML library. What I need to know is how make an object (ex:laser) fire up from object (ex:player) when a user press button??
I am currently working on a "bag" class which is sort of a common sense answer to creating a random class with difference functions. I am attempting to create a "union" function which takes two bags ie: bag1 and bag2, adds all the items in both bags and creates a new bag ie: "bag3". For some reason I keep coming up with problems instead of solutions. Maybe it's the fact I just got done with 2 days of calculus. I don't know. My code is below. Both a main(source) and header file.
Header
#ifndef BAG_H #define BAG_H const int BAG_CAPACITY = 20; template <typename T> class Bag { private: int count; // Number of items in the Bag
I am making a level editor that needs to output a custom map file for use with source code that I will write for a graphics library.
My question is: What do I need to bear in mind when deciding how to structure a custom file type? Also how can I encode a standard bitmap image into my file (the tile set) so that it can all be contained in a single file rather two files; the map file and tile set (.bmp file).
I'm unable to get the grades to print in the table format, it only takes the homework grades and not the tests and quizes.
// week 8.cpp : Defines the entry point for the console application. // Gradebook 1.cpp :
/*Rewrite the program "Gradebook 1" to contain 1-dimensional arrays. All information entered or calculated within the program is located in an array. The final output(Class Summary) should contain a summary sheet that contains all of the information in table form. */
#include "stdafx.h" #include <stdio.h> #define Size 30//Maximum class size #define max 100//maximum grade #define min 0//minimum grade
[Code] .....
This is my result :
Welcome to the Gradebook Program.
Please enter the number of students: 2 Enter the number of Tests to be averaged: 2 Enter the number of Quizzes to be averaged: 2 Enter the number of Homework assignments to be averaged: 2