Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
~7K People Reached
PC Specs
computer programming
Favorite Forums
Favorite Tags
Member Avatar for slygoth

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, …

Member Avatar for bguild
0
155
Member Avatar for slygoth

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]; …

Member Avatar for Despairy
0
197
Member Avatar for slygoth

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 …

Member Avatar for Ancient Dragon
0
130
Member Avatar for slygoth

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 …

Member Avatar for slygoth
0
160
Member Avatar for slygoth

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

Member Avatar for Ancient Dragon
0
136
Member Avatar for slygoth

[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]); } …

Member Avatar for Ancient Dragon
0
131
Member Avatar for slygoth

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 …

Member Avatar for peter_budo
0
191
Member Avatar for slygoth

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 …

Member Avatar for WaltP
0
252
Member Avatar for slygoth

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

Member Avatar for Ancient Dragon
0
63
Member Avatar for slygoth

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 …

Member Avatar for slygoth
0
105
Member Avatar for slygoth

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 …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for slygoth

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. …

Member Avatar for Stefano Mtangoo
0
271
Member Avatar for slygoth

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 …

Member Avatar for slygoth
0
98
Member Avatar for slygoth

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 …

Member Avatar for slygoth
0
2K
Member Avatar for slygoth

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); …

Member Avatar for rubberman
0
170
Member Avatar for slygoth

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 …

Member Avatar for fpsasm
0
167
Member Avatar for slygoth

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 …

Member Avatar for gerard4143
0
185
Member Avatar for nory22

Hi There PLease i Need Help>>>> :) [COLOR="Red"]can any one Write me a program to do the following[/COLOR]..?PLzzz It costs 1.500$ for each 20 minutes traveled by taxi. Enter the rate at which the driver is driving along with the distance that is to be traveled then calculate the amount …

Member Avatar for nory22
-1
201
Member Avatar for slygoth

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 …

Member Avatar for slygoth
0
206
Member Avatar for slygoth

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

Member Avatar for Arbus
0
319
Member Avatar for slygoth

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 …

Member Avatar for jnawrocki
0
162
Member Avatar for rodel123

Create a program that will accept a date in numbers and output the date in long format. Have your program trap for the leap year and also invalid inputs. Your program will also ask if the user wants to input again. Range for year (1980-present) plsss help me ASAP...tnx!!!

Member Avatar for slygoth
-1
111
Member Avatar for slygoth

[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 …

Member Avatar for slygoth
0
151
Member Avatar for xshashiy

hi i want to generate non repeated random numbers many times. for that i m using the following code. [code]#include "sys/types.h" #include "stdio.h" #define MAX 200 #define N 20 main() { int array[N],r; int n = 0; int count_check,count_gen ,i,j; for(j=0;j<10;j++,printf("\n")) { srand(j); for (count_gen=0;count_gen<=MAX;count_gen++) { r = rand()%N; for …

Member Avatar for slygoth
0
222