C

22K

Solutions

20

Articles & Videos

13K

Contributors

C is a general-purpose, imperative computer programming language, supporting structured programming, lexical variable scope and recursion, while a static type system prevents many unintended operations. By design, C provides constructs that map efficiently to typical machine instructions, so it has found lasting use in applications that had formerly been coded in assembly language, including operating systems as well as various application software for computers ranging from supercomputers to embedded systems. It is distinct from C++ (which has its roots in C) and C#, and many later languages have borrowed directly or indirectly from C.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hello!

I have a database (attached) and I want to be able to export the first two sheets to a PDF. However, the code I have now (below) which runs after clicking the Print Bid button, only converts part of the first worksheet. When the user is using this database there could potentially be many more work items and therefore I need the code to convert everything in all the columns to a PDF, except column C. That is the next problem, the Jump To column, column C, in the first worksheet should not be visible in the PDF but right now, despite the code, it is. If anyone has any suggestions on how to change these two things that would be wonderful! Thank you!

Sub PrintToPDF()
    Dim oWs As Worksheet
    Sheets("summary").Columns("C:C").EntireColumn.Hidden = True
    Set oWs = Sheets("summary")
    With oWs.PageSetup
        .FitToPagesWide = 1    ''/// prints to one page
    End With

    oWs.Columns("C:C").EntireColumn.Hidden = False

    With Sheets("service rates").PageSetup
        .FitToPagesWide = 1    ''/// prints to one page
    End With
    ''///Save the Array of worksheets (which will be selected) as a PDF
    ThisWorkbook.Sheets(Array("summary", "service rates")).Select
    On Error Resume Next
    oWs.ExportAsFixedFormat _
            Type:=xlTypePDF, _
            Filename:="Test.pdf", _
            Quality:=xlQualityStandard, _
            IncludeDocProperties:=True, _
            IgnorePrintAreas:=False, _
            …
0
Industry Leaders: We Want Your Opinion!
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

I'm programming Infineon TC29x Aurix Tricore Microcontroller based embedded system in 'C' language.  

Consider stack starting address 0x5000 0000.  The stack size is 0x2000.  

If I take current stack pointer minus 0x2000, will that create stack exception?  If yes, what might be 'C' or assembly language code that will achieve this?

My thought is if I subtract negative 0x2000 from current stack pointer or add 0x2000 to current stack pointer, I'll be outside stack and stack exception will occur ?

 I need to set program counter to illegal address, i.e. 0x00FF FFFC.  Can this be done with assembly language instructions?
 If yes, please instrument assembly language instruction that would set program counter to 0x00FF FFFC while code is running.
0
I'm trying to create illegal instruction reset.  

I'm programming Infineon TC29x Aurix Tricore Microcontroller based embedded system in 'C' language.  

I need to set program counter to illegal address, i.e. 0x00FF FFFC.  Can this be done with assembly language instructions?
If yes, please instrument assembly language instruction that would set program counter to 0x00FF FFFC while code is running.
0
I would like to implement a fast fixed point sine approximation for PIC24F microcontrollers on 16bit.
I started from here: http://www.coranac.com/2009/07/sines/
The approximation is done with polynomials: 3rd order up to 5th or even 6th order.
I am stuck in the beginning.
The 3rd order polynomial is S3(x)=(3/PI)*x-(4/PI^3)*(x^3) or S3(z)=(1/2)*z*(3-z^2) with z=x/(1/(2*PI))
I tried an Excel sheet for this function and I compared with sin() from Excel.
Either I make a mistake or the approximation error is too big.
Here is the Excel: https://goo.gl/2KJXj8 
Could you help to debug this?
0
I have following version of eclipse installed in my computer:

Eclipse IDE for C/C++ Developers

Version:  Neon.1a Release (4.6.1)
Build id:  2016 1007-1200

From main menu, I go to Window  -   Preferences  -  Indexer   but Indexer doesn't run ?

I need to run Indexer so I can navigate my source code.
0
We are using TC29x Microcontroller. The flash size is 6Mbytes. There are Three banks, 2Mbyte each.

Program Flash 0 (PF0) is bank 1. Program Flash 1 (PF1) is bank 2. Program Flash 2 (PF2) is bank 3.

 PF0 address range is: 0x8000 0000 - 0x801F FFFF
 PF1 address range is: 0x8020 0000 - 0x803F FFFF
 PF2 address range is: 0x8040 0000 - 0x805F FFFF

 Where is Program Flash ECC stored. Is it within 6Mbyte ? Or is there additional storage space for ECC that we don't have access to ?

 How does Flash ECC work ? For how many bytes of data, how many bytes of ECC are there ? Whenever we write to flash, ECC updates? When we erase flash ECC updates?

 How is it possible to create Flash ECC Error ? Because everytime you write or erase flash, ECC will update?
0
Attached is data dump of some example symbol "ast".  This symbol starts at address 0x0000 6814.

What is oriented display and what is line break at 2 power x ?
Orient-Display.PNG
0
Hi,

I have a C program which would be doing some task and returning a value to me. I would like to capture this value either in CL or in Java code. Anyone having any idea how I can accomplish this?
0
Hello everyone,

I am making a code where I should display date and time in the beggining, so since I am still a begginer in C, I found some codes to display it.
#include <stdio.h>
#include <time.h>
void timeNdate();
void main(){
timeNdate();  
getch();
}
void timeNdate(){
char date [6];
char time [6];
_strdate( date );
_strtime( time );
printf("DATE/Time:  %s / %s",date,time);
}

I want to know what is _strtime and _strdate and how are they used, I need to explain this to my professor at the end.
Thank you very much for your help!
0
#include<stdio.h>
#include<conio.h>
#include<ctype.h>

main(){
	char first[100], last[100];
	int i, mon, c, dd, mm, yyyy;
	long double bor, lend, total, term;
	long long long id;
	
	clrscr();
	printf("Lending System\n\n");
	printf("Input Lender ID#: ");scanf("%11d", &id);
	printf("\nLast Name: ");scanf("%s", &last);
	printf("\nFirst Name: ");scanf("%s", &first);
	printf("\nAmount to lend: ");scanf("%Lf", &lend);
	
	printf("\nDate lend: \n");
	Date:
	printf("\n DD [01-31: ");scanf("%d", &dd);
		if (dd<1 || dd>31){
			printf("Enter valid date.");
		goto Date; }
		
	Month:
	printf("\n MM [01-12]: ");scanf("%d", &mm);
		if (mm<1 || mm>12){
			printf("Enter valid month.");
		goto Month; }
		if (mm>0 && mm<13){
			if (dd==28 && mm!=2){
			printf("Enter valid month.");
		goto Month; }
		if (dd==31){
			if(mm==2 || mm==4){
				printf("Enter valid month.");
		goto Month; }
			else if(mm==6 || mm==9){
				printf("Enter valid month.");
		goto Month; }
			else if(mm==11){
				printf("Enter valid month.");
		goto Month; }
		}
		if (dd==30){
			if(mm==2){
				printf("Enter valid month.");
			goto Month; }
		}
	}

Year:
printf("\n YYYY: "); scanf("%d", &yyyy);
	if(dd==28 &&mm==2){
		if(yyyy%4 !=0){
			printf("Enter valid year.");
		goto Year; }
		}

printf("\nInterest Increase: 5%");
printf("\n\nTerm in Months: "); scanf("%d", &mon);
total = lend*1.05;
term = total/(long double)mon;
		
for (c=0; c<100; c++){
	last[c] = toupper(last[c]);}
for (c=0; c<i; c++){
	first[c] = 

Open in new window

0
Independent Software Vendors: We Want Your Opinion
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Hi
I am connecting GSM(SIM 800) module to my PC through serial to USB. I want send SMS to GSM module by PC .
using COM4 port serial communiction in PC(windows 7).
I tried writing this code
#include<stdio.h>// include stdio . h
#include<stdlib.h>// include stdlib . h
void initialize_GSM_modem(void);
void initialize_serialcommunication(void);
unsigned char Command_CMGF[]="AT+CMGF=1\r";
// AT+CMGF for selecting Text Mode
unsigned char CtrlZ=0x1A;
// CTRL+Z for sedning SMS after the message has been entered
unsigned char Command_CMGS[]="AT+CMGS =+9233385xxxxx\r";
// recepient mobile number
unsigned char Command_AT[]="AT\r";
unsigned char msg02[]="Hello!";
void main (void) {
initialize_GSM_modem();
initialize_serialcommunication();
while (1) {
;
}
}
void initialize_GSM_modem(void){
delay2();
puts(Command_AT);
delay2();
puts(Command_CMGF);
delay2();
puts(Command_CMGS);
delay2();
puts(msg02);
delay2();
}
void initialize_serialcommunication(void){
 HANDLE hCom;
 DCB dcb;
BOOL fSuccess;
   TCHAR *pcCommPort = TEXT("COM4"); //  Most systems have a COM1 port

   //  Open a handle to the specified com port.
   hCom = CreateFile( pcCommPort,
                      GENERIC_READ | GENERIC_WRITE,
                      0,      //  must be opened with exclusive-access
                      NULL,   //  default security attributes
                      OPEN_EXISTING, //  must use OPEN_EXISTING
                      0,      //  not overlapped I/O
                      NULL ); //  

Open in new window

0
Cross compiling a program - compiler creates the object file but the native linker is being used and failing.
I am feeding the linker as a command line argument to make (as LD).

How do I specify an alternate linker?

Thank you.
0
I have been up the last three nights being paged about high cpu usage on AIX 7.1
I can run nmon the press c then press u and nmon displays the top cpu processes/programs

is there a way to run that in a script and capture the output?

any help would be appreciated
I have tried several options to put the info in a file but cannot get the output desired
the summary of top cpu when running the command includes
PID %CPU ResSize Char Command - don't really need the Char column
0
I am a C#.NET ASP.NET Web/Windows developer. And I know a bit of Objective C from the iPhone app which I helped to write. I even started an Android version with Java. But I would never use those languages ever again to get support on one platform.

So, now that .NET CORE supports many cell platforms, I MAY write my next mobile app.

What platforms are supported? What technologies are needed to write an iPhone app?

And Android app?

Is this a .NET Website? Otherwise please explain a bit about what CORE is all about?

I have a Mac, so I would run Visual Studio on El Capitan, I presume.

I am really excited about this, so please let me know...


Thanks
0
Hello!
I am trying to free up C drive space by cleaning up items from the Winsxs folder using the Disk Cleanup utility which I installed from the server features. However, there does not appear to be an option to cleanup the Winsxs folder in the utility as there is in the R2 options. Can someone tell me how I can go about cleaning up space in the Winsxs folder given this? I have folders in there from 2008 and I figure I surely can delete at least a chunk of this folder given the ages of these folders (I have not plans to rollback to those updates :D)
0
How to add to the right side of table A ,  the colums and data of 2 other tables B and C .
Example:
table A: col1 (pk) , col2  -- 10 rows
table B: col3 (pk) , col4  -- 10 rows
table C: col5 (pk) , col6  -- 10 rows

Each table have all pk values that exist on the other 2 tables.

the result should be as follows:
table A: col1 (pk) , col 2 , col4, col6
0
Hello All,

I have been trying to get some assistance and received various inputs in one of the earlier question to run a .bat file on multiple servers.
Below is the steps I want to execute:

a. We have 109 server (Windows 2012 Server)
b. There is a batch file in D drive with same name and location on all 109 servers
c. I want to run that particular batch file on all servers in one go
Usually when I login to my session using credentials and launch the batch file, multiple command prompt windows start loading. When I used PSexec script it works for individual machine but there too I had a challenge... If my PC gets locked the batch file fails and stops.

All I am looking here is to run that particular batch file on all servers and if I login to my session I should see it has started. I want the batch file to run under by login session. Please help as this is very critical to be completed ASAP.

Let me know if any more information required.
1
flow chart tower of hanoi graphical representation in c language and flowchart of  stack how to use of tower of hanoi
0
write a program for airline ticketing system?
Today's price of ticket from LA to Washington DC is 500 $, California 400$, Victoria 8oo$, there is half ticket for Childers bellow 12 years of age and infants bellow 4 years of age will be charged 100$ each for any destination and all the registered clients will get 10% off.
write a program to ask the client either he is a registered user or non-registered. Then ask how many passengers they want to travel, ages of all the passengers, destination where they want to go. Finally print the ticket like that.
For example:
 5 passengers want to get ticket for destination Washington Online ticket from LA to Washington 5 passengers
1. 40 year male--- 500
2. 35 years female--- 500
3. 15 years male --- 500
4. 10 years child--- 250
5-3 years infant 100
Total 1850 $ You are registered user will get 10% off Total 1665 $
Do you want to purchase another ticket Y/N
0
Technology Partners: We Want Your Opinion!
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

i need to read a path from a dll created in visual studio c++ 2010 in LABWINDOWS CVI (C)
.h is
 #ifndef IMAGE_H_
#define IMAGE_H_   

#ifdef COMPILING_DLL  
#define DLLEXPORT __declspec(dllexport)  
#else  
#define DLLEXPORT __declspec(dllimport)  
#endif  

#ifdef __cplusplus
extern "C" {
#endif

DLLEXPORT char* __cdecl read();

#ifdef __cplusplus
}
#endif

#endif[

Open in new window


and .cpp

#include "D:\opencv3.0\opencv\build\include\opencv2\highgui\highgui.hpp"
#include "D:\opencv3.0\opencv\build\include\opencv2\core\core.hpp" 
#include <iostream>
#include "image.h"
#include <stdexcept>

#define COMPILING_DLL
using namespace cv;
using namespace std;


	char*__cdecl read()
{char* path = " C:\\Users\\eouerten\\Desktop\\visual_cvi\\essai_visual_cvi\\essai_read\\cat.jpg";
    Mat mat = imread(path, CV_LOAD_IMAGE_UNCHANGED); //read the image data in the file "MyPic.JPG" and store it in 'img'

    if (mat.empty()) //check whether the image is loaded or not
    {
        cout << "Error : Image cannot be loaded..!!" << endl;
        //system("pause"); //wait for a key press
        return path;
    }
	}

Open in new window


the main .c is

#include <ansi_c.h>
#include "image.h"

int main()
{

    char* p=read();
    getchar();
    printf("l'adresse de l'image est %s" ,p);
  return 0;
}

Open in new window

Result : build succeeded but the problem that i can't run it :erreur 0xc000007b i verified all dll like mscvp100.dll but it's not the problem
0
I have a file that has a header record in A1 and a trailer record in it at the end.  The lines between is the data I want to edit that start in Cell A2.  So Header record in A1 then Data in A2 then A3 then A4 and so on until it gets to the end with the last record being the trailer record.

What I want the macro to do is look in the file (attached as Data) and go to the first record in A2 and get the number in positions 43 through 48.  Then look in the Reference file and find that number in Column A and get the 2 digit code in column C.  Then go back to the record and replace positions 74 and 75 with that information.

So if I look at cell A2 in the data file and count over to positions 43 - 48 I get   321482
Then if I look in the Reference file and find that number I see in Column C the information is   5A
Then knowing 5A is what I want to replace I go to the record in the data file and count over to position 74 and 75 I see the value in there is 48.
Then I replace the 48 with 5A
Then I need to move to the next record and do it. and the next record, and the next record etc.

Hope this is detailed enough and a macro is possible.  Thanks in advance.
Data.xls
Reference.xls
0
Hi experts,

I have the following question

I have an array

vector<long> v = {5,7,2,10,4,6};

I did the Bit wise operation & of the first 4 numbers

5&7&2&10 = sum

now I need a sliding window i.e.
compute 7&2&10&4

I need  to perform the operation by removing first element and adding last element , how can I achieve that using bitwise operations ?

   something like  newSum =  ???sum&4,

I tried newSum = (~7)|(sum&4) but it gave a negative result .

Thanks
0
Hi Guys,

I need help to perform the following
I have a the following class that has 3 functions with same name but different parameters type
class A : public ParentClass {
 void handleEvent (EventA ){}
void handleEvent(EventB){}
void handleEvent(EventC){}
}
Is there a way to store them in a map as function pointer and then call them back based on the type of event received ?

I was going to do :
Map<string, void*> map;
Map[eventAId] = &handleEvent  // here is the issue all the functions have the same name
Is there a way to fix that ?

I am using C++ 11 and stl library.
0
Hi we recently upgraded our SCCM 2012 sp1 server to 2012 R2 SP1 console version 50.0.8239.1502, site version 5.00.8239.1000. The problem we having now is that the existing deployments are just stopping at the point where the task sequence would install applications. we logged a call with Microsoft but that's not getting us anywhere thus far. The funny thing is I found a post online about it creating an _sms task sequence folder on the c drive and then failing when trying to read from the folders on the local drive. Basically it fails without an error once the client gets installed, I simply get prompted to restart the machine via a countdown which is part of the task sequence. We have office, adobe and two device driver installations that are meant to carry on after that point, but it never gets that far. The network access account is working fine and can access the source content, so I'm stumped. please help.
0
Hey..
  i want to create an image file of C drive of my server .. with all S\W ... When i run that iso file or create neew server at that time with all application it must be get installed .. is it possible ... pplz help ..
0

C

22K

Solutions

20

Articles & Videos

13K

Contributors

C is a general-purpose, imperative computer programming language, supporting structured programming, lexical variable scope and recursion, while a static type system prevents many unintended operations. By design, C provides constructs that map efficiently to typical machine instructions, so it has found lasting use in applications that had formerly been coded in assembly language, including operating systems as well as various application software for computers ranging from supercomputers to embedded systems. It is distinct from C++ (which has its roots in C) and C#, and many later languages have borrowed directly or indirectly from C.