49,761 Topics
| |
Is there a simple way to just be able to add milliseconds to my timestamp function? [code]char stamp[100]; time_t mytime; struct tm *mytm; mytime=time(NULL); mytm=localtime(&mytime); strftime(stamp,sizeof stamp,"%a, %d %b %Y %H:%M:%S %z",mytm); printf("%s\n" , stamp);[/code] | |
Hi guys I am a new IT guy.my task is to manipulate time and date.I use two separate classes for time and date. Now i need to integarate them, so which one is best Inheritance or containment | |
Hey, I was wondering if any one could help me with several problems I am having. 1st problem: Can anyone tell me how to combine two int's and put a ':' in between. Bascially I want the user to enter the hour and minutes separately, then combine them both together … | |
well i use bootime function to get and store time in my bios but i want to enter time in my system . what should i use for time and what to do for date well i am using time.h header files for that also i need to know about … | |
HOW DO I COMPARA CHAR INTO A INTGER STRING? ----------------------------------------------------- #include<string.h> #include<conio.h> #include<iostream.h> #include<stdio.h> #include<ctype.h> #define g gotoxy //*design void design() { int ctr; for (ctr=0;ctr<9;ctr++) { textcolor(LIGHTBLUE); cprintf("--"); } } //------------------------------------------------- void maine() { clrscr(); g(8,3);design(); g(8,5);design(); g(27,4);cout<<"DATA STRUCT COMPANY INVENTORY SYSTEM"; int total=0,totalprice=0; int count,ctr=9; struct { char … | |
Hello. I'm still fairly new with C++. I started on a code with a friend, but I'm still very unsure about setting up loops and such. Some help on where to go next with this problem would be much appreciated! This program requires you to input information about vehicles in … | |
Hey all, i have been reading some c++ books and they talk about a variable type called float but they also mention another one named double and another one named long double but what i don't understand is the difference, the furthest i get is that they tell me float … | |
i have a code that reads lowest and the highest number with inputs that are all Integer but, once i have an input (ex. apple 200)...it wont read anymore, need help in what to input code that ignores letters [CODE]//reads numbers only ex. 100 200 300 int main() { ifstream … | |
iamd using turbo c++ 4.5 and i need help in creating gui there i need some tutorials for that .. | |
The problem is in dayOfWeek () I think. It may be overloaded or something. [code] #ifndef DATE_H #define DATE_H class Date { public: Date( int = 1, int = 1, int = 1900 ); // default constructor void print() const; // print date in month/day/year format int dayOfWeek (); // … | |
Hello I want to create a web plugin to demonstrate some inverse kinematics algorithms on a basic 3D model on a web browser. I am using OpenGL API and my code is written in C++. I am really new to plugins and I have no clue where to start looking. … | |
| I recently found an old game in which the soundtrack is read from an audio cd. I would like to redirect this via a proxy dll (winmm.dll) to read the soundtrack from certain mp3 files, possibly via FMODEx. So far I have been unsuccessful in every attempt. The game calls … |
Hello, I've copied a multiarray into another multiarray and can't figure out how to convert an int of 1 into an asterik which is ascii 42 I believe. I need help to replace all 1's to an asterik. I've tried static cast which my instructor suggested but I must be … | |
Hi, my assignment asked me to make a 3 row, 7 column array that asked the user to input amount of food for 3 monkeys. 7 represents the number of days. It should tell the user the average, highest and lowest amount for this.. Here is what I've got so … | |
I've got a program that has three different classes, all of which have their own pointer to an class called ObsFileName, who's main functionality is to store the name of an output file individual to the class, and return it with a function value(). All throughout the program, when a … | |
Please excuse me but what is SAPI reference API? :icon_biggrin: | |
As I know that .c is the extension format for c coding while cpp is the extension for c++. But I noticed that there are some c++ project use .c extension instead of cpp, is it both extension is supported in c++ compiler? | |
I am trying to create a C++ program that queries data from an ODBC data source. I am very comfortable with C++ and SQL, im just not sure how to set up an ODBC connection in C++. I have tried searching google and have not been very successful. Im using … | |
I'm creating a linked list,adding the data I've read from file in each node but as I'm trying to print what I hold in nodes my output is some symbols.And even when I cout what I hold in my nodes in ADD function it's ok but as it goes to … | |
how to reverse a string in character array without using string functions... | |
#include <iostream> #include <cstring> using namespace std; int main() { int i,n,len; char x[3]; char status[15]; cout<<"This is an airplane passengers seats program"<<endl<<endl; for(n=1;n<=7;n++){ cout<<n<<" \tA\tB\tC\tD"<<endl<<endl; } cout<<"Please enter your seat accordingly : "; cin.getline(x,3); cout<<endl; len=strlen(x); // for (i=0;i<=len;i++) // x[i]=toupper(x[i]); for(int j=1;j<=7;j++){ cout<<j<<" \tA\tB\tC\tD"<<endl<<endl; } cout<<"Thank you for … | |
Hello All, I would like the user to be able to choose the file_name (assuming it already exists) and be able to append information to it. However, this condensed version, below, of what I'm trying to do gives me a compilation error. I feel like it has something to do … | |
#include<iostream> #include<string.h> int main() { char* str="my name"; /*plz explain what is pointer-name,and what is string- name here(realy confused) ? i am new to pointers :) */ int len=strlen(str); char* ptr; ptr=new char[len+1]; /*is this ptr pointer or string*/ strcpy(ptr,str); cout<<ptr; delete ptr; /*how this works */ cout<<endl<<ptr; /*this 'ptr' … | |
Hey! Again, small but devious problem for me: I have a string that gets time as an input, in a format like "9.45" or "15.37". How do I extract the hours and minutes to integer variables, when the hour part may consist of either one or two digits? If it … | |
Hi, Is it possible to allocate memory using malloc() (C) and release it using delete (C++) or even the opposite Alocate with new (C++) and release with free() (C) If not Why? | |
free online test of C/C++ <URL SNIPPED> | |
Write a program to assign passengers seats in an airplane. Assume a small airplane with seat numberings as follows: 1 A B C D 2 A B C D 3 A B C D 4 A B C D 5 A B C D 6 A B C D 7 … | |
Hi, im just a beginner in C++ and was wondering what exactly are pointers used for? Are they just to refer back to something or are they used differently than that? I was reading through the chapter on pointers in my programming book and it doesn't really clarify. | |
Hi guys, i have this D3D code here: [code]void drawArrow(float x, float y, float yaw, D3DCOLOR color) { D3DXVECTOR2 points[3]; points[0] = D3DXVECTOR2(-3, 5); points[1] = D3DXVECTOR2( 0, 0); points[2] = D3DXVECTOR2( 3, 5); D3DXVECTOR2 points2[3]; float rad_dir = D3DXToRadian(-yaw); for (int i=0; i<3; i++) { points2[i].x = ((points[i].x * … |
The End.