- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
24 Posted Topics
Hello I am trying to insert some data into a sql server i have but it seems like I'm formating the information wrong. This is what i have so far. product id = int; type = string; watt = float; volts = float; String query = "INSERT INTO GoodCustomer(Product ID, … | |
I am trying to store some values return from a function. Its returning three values that i want to use in the main function. int display() { int iter; int num[4]; if(dl!=-1) { for(iter=0 ; iter<=al ; iter++) { cout<<t[iter]<<", "; num[iter]=t[iter]; } } else cout<<"EMPTY"; return num[0]; return num[1]; … | |
I have been trying to read back the information from a file that i created. I get all the information i need out of the file but now all i want is to use the display function from the linklist to get that information. I would like it if the … | |
I am working on this project and i am going to need to write information and retrieve them from a file. I get all the information needed but i am not sure how to write it to a file and how to get it back. if (id.is_open()) { cout<<endl; cout<<"Enter … | |
Hey guys i need to color code [CODE] printf("hello World");//how do i change this to green printf("How are you");//How do i change this to yellow or something [/CODE] How do i change the color of the text inside the printf | |
[CODE] FILE *ranch; FILE *myfile; char line[500]; case 1: ranch=fopen("garrudaRanch.txt ","w+"); if(ranch != NULL) { printf("Enter amount of Corral: \n"); scanf("%d",&corral); fprintf(ranch,"%d\n",corral); printf("Enter size of Corral: \n"); scanf("%d",&corrals); fprintf(ranch,"%d\n",corrals); } fclose(ranch); break; case 2: myfile=fopen("garrudaRanch.txt ","r+"); if(myfile != NULL) { //fscanf(myfile,"%s",line[1]); printf("Number of Corral: %s",line[1]); printf("Size of Corral: %s",line[2]); } … | |
Hey guys. Im trying to open a file the user entered. [CODE] cout<<"Please enter the file name"; cin>>name; cout<<"Do you want to open the file? [yes] or [no]"<<endl; cin>>pick; if(pick=="yes") system("C:\\wmplayer.exe [COLOR="Green"]fname[/COLOR]"); else cout<<"Good bye"; [/CODE] How do i get the value thats in fname to be printed their so … | |
Im trying to open a file. The user enters the name of the file they want to open example [CODE] string fname; string pick; cin>>fname; cout<<"Do you want to open the file?"; cin>>pick; if(pick=="yes") system("wmplayer.exe [COLOR="Green"]fname[/COLOR]"); else cout<<"Thanks for your time; [/CODE] Can someone show me how the replace the … | |
Sorry to post this here How do I write a query to double the `buyprice` of every item that costs less than 20US. Can someone help me with this please. I had UPDATE Account SET buyprice This is where i got stuck been searching google but couldnt find it | |
In this code i would like to store the values that are being outputted. [CODE] fstream filestr; char check[4]; filestr.open("D:\\bio.pdf", fstream::in | fstream::binary); if(filestr.is_open()) { int i; char check[4]={0}; for(i=0;i<4;i++) { filestr.read(&magic[i],1); [COLOR="Red"]cout<<hex<<static_cast<int>(check[i])<<endl;[/COLOR] //<-- This LINE } } [/CODE] The numbers that are printed here i would like to save … | |
Hey guys. I just learn about magic numbers today. I am trying to make a program that uses fstream along with magic numbers to tell what a file is. Example the magic numbers for jpg are ff d8 ff e0. How do i check a file to see if its … | |
I am trying to open a text file in C++. I dont want the file to be open in the console i want to open the file using one of the text editors like gedit. Can someone show me how to open it using gedit and not in the console. … | |
Hey guys i am having a little trouble with this code [CODE]# include <fstream> # include <iostream> # include <string> using namespace std; int main() { fstream filestr; filestr.open("text.txt", fstream::in | fstream::out | fstream::app); filestr.close(); return 0; }[/CODE] But i keep getting a error when i run it 1> All … | |
Hey guys i am interested in knowing how to let my C++ open images. Like set the location on the image in C++ and when i click it, it opens image viewer. Also would like to know if i can do the same thing with music. Like put a list … | |
the structure and other things have been declared already just need some help with writing this info to the file with random access method. customer info; void customerinfo(customer); [CODE]void customerinfo(customer info) { FILE *ci; if ((ci=fopen("testing.txt","ab"))==NULL) printf("File \"testing.txt\" could not be opened"); else { printf("Customer ID: "); fflush(stdin); scanf("%d",& info.cusid); … | |
Im writing a code to generate invoice numbers. Im using a file now that increment to number each time but i was just wondering if there is a way to use time so that it can generate a invoice using time or date. Like the first 4 digit would give … | |
I have this code but the floats wont print to the file. Everything else prints and works well but the floats i see 0.000. Can someone tell me where im going wrong. I already declare them in the struct as float apaid; float tpaid; [CODE] customer customerinfo(customer info) { FILE … | |
Re: you miss the %f sign shauzi [code]printf("Total Amount: %f", amount);[/code] | |
Write a function that accepts a pointer to a string and a character and returns the number of times the character is found in the string. [CODE] # include <stdio.h> # include <conio.h> # include <string.h> # include <stdlib.h> void countletter(char *str); int main() { char str; printf("Please enter a … | |
Hey can someone help me with a code to mask password. To print * when the user enter a value and when they hit backspace it takes back a *. Im having trouble figuring out the code | |
I need some help with the toupper code. [code] int main() { char pick; printf("A. Local needs\n"); printf("B. Local Service\n"); scanf("%d",& pick); switch (pick) { case 'a': printf("Hello World"); case 'b': printf("Hello Nation"); } getch() return 0; } [/code] How would i implement the toupper code so i could change … | |
Re: If you started the question and need some help with it we would be happy to. But just asking for a program like that wont get you much help | |
[code] # include <stdio.h> # include <conio.h> # include <time.h> # include <stdlib.h> # include <string.h> # include <ctype.h> int start; int last; # define SIZE 10 int largest (int num[],int msize); int smallest(int num[],int asize); int main() { int num[10]={0}; int i; int min; int max; int pick; int … | |
Re: Yes all you need to do is use srand(time(NULL)); but make sure to add # include <time.h> and # include <stdlib.h> |
The End.